Skip to content

Commit 18e6fb0

Browse files
authored
models : handle spaces and special characters in shell script paths (ggml-org#677)
This commit modifies the `get_script_path` function to correctly handle spaces and special characters in directory paths. The fix involves adding double quotes around variables and commands where needed to ensure proper parsing of paths with spaces and special characters.
1 parent 0f759f1 commit 18e6fb0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/download-ggml-model.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pfx="resolve/main/ggml"
1212
# get the path of this script
1313
function get_script_path() {
1414
if [ -x "$(command -v realpath)" ]; then
15-
echo "$(dirname $(realpath $0))"
15+
echo "$(dirname "$(realpath "$0")")"
1616
else
1717
local ret="$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)"
1818
echo "$ret"

0 commit comments

Comments
 (0)