Skip to content

Commit b782422

Browse files
authored
devops : add missing quotes to bash script (#2193)
This prevents accidentally expanding arguments that contain spaces.
1 parent 1cbf561 commit b782422

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

.devops/tools.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ shift
1010
# Join the remaining arguments into a single string
1111
arg2="$@"
1212

13-
if [[ $arg1 == '--convert' || $arg1 == '-c' ]]; then
14-
python3 ./convert.py $arg2
15-
elif [[ $arg1 == '--quantize' || $arg1 == '-q' ]]; then
16-
./quantize $arg2
17-
elif [[ $arg1 == '--run' || $arg1 == '-r' ]]; then
18-
./main $arg2
19-
elif [[ $arg1 == '--all-in-one' || $arg1 == '-a' ]]; then
13+
if [[ "$arg1" == '--convert' || "$arg1" == '-c' ]]; then
14+
python3 ./convert.py "$arg2"
15+
elif [[ "$arg1" == '--quantize' || "$arg1" == '-q' ]]; then
16+
./quantize "$arg2"
17+
elif [[ "$arg1" == '--run' || "$arg1" == '-r' ]]; then
18+
./main "$arg2"
19+
elif [[ "$arg1" == '--all-in-one' || "$arg1" == '-a' ]]; then
2020
echo "Converting PTH to GGML..."
2121
for i in `ls $1/$2/ggml-model-f16.bin*`; do
2222
if [ -f "${i/f16/q4_0}" ]; then
@@ -26,8 +26,8 @@ elif [[ $arg1 == '--all-in-one' || $arg1 == '-a' ]]; then
2626
./quantize "$i" "${i/f16/q4_0}" q4_0
2727
fi
2828
done
29-
elif [[ $arg1 == '--server' || $arg1 == '-s' ]]; then
30-
./server $arg2
29+
elif [[ "$arg1" == '--server' || "$arg1" == '-s' ]]; then
30+
./server "$arg2"
3131
else
3232
echo "Unknown command: $arg1"
3333
echo "Available commands: "

0 commit comments

Comments
 (0)