Skip to content

Commit 90a54db

Browse files
committed
Don't commit ngram, build it instead
1 parent 1f8c509 commit 90a54db

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ bin/configlet
77
bin/configlet.exe
88
bin/exercise
99
bin/exercise.exe
10+
bin/generator-utils/ngram
1011
exercises/*/*/Cargo.lock
1112
exercises/*/*/clippy.log
1213
canonical_data.json

bin/generator-utils/ngram

-521 KB
Binary file not shown.

bin/generator-utils/utils.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ ${unimplemented_exercises}"
5454

5555
# Find closest match to typed-in not-found slug
5656
# see util/ngram for source
57-
echo "${YELLOW}$(bin/generator-utils/ngram "${unimplemented_exercises}" "$slug")${RESET}"
57+
# First it builds a binary for the system of the contributor
58+
if [ -e bin/generator-utils/ngram ]; then
59+
echo "${YELLOW}$(bin/generator-utils/ngram "${unimplemented_exercises}" "$slug")${RESET}"
60+
else
61+
cd util/ngram && ./build && cd ../.. && echo "${YELLOW}$(bin/generator-utils/ngram "${unimplemented_exercises}" "$slug")${RESET}"
62+
fi
5863

5964
exit 1
6065
fi

util/ngram/build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/usr/bin/env bash
2-
cargo build --release && cp ./target/release/ngram ../../bin/generator-utils && rm -rf ./target
2+
cargo build --release --quiet && cp ./target/release/ngram ../../bin/generator-utils && rm -rf ./target

0 commit comments

Comments
 (0)