Skip to content

Commit

Permalink
models : handle spaces and special characters in shell script paths (g…
Browse files Browse the repository at this point in the history
…gerganov#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.
  • Loading branch information
be-next authored Mar 29, 2023
1 parent 0f759f1 commit 18e6fb0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/download-ggml-model.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pfx="resolve/main/ggml"
# get the path of this script
function get_script_path() {
if [ -x "$(command -v realpath)" ]; then
echo "$(dirname $(realpath $0))"
echo "$(dirname "$(realpath "$0")")"
else
local ret="$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)"
echo "$ret"
Expand Down

0 comments on commit 18e6fb0

Please sign in to comment.