Spaces:
Sleeping
Sleeping
be-next
commited on
models : handle spaces and special characters in shell script paths (#677)
Browse filesThis 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.
models/download-ggml-model.sh
CHANGED
|
@@ -12,7 +12,7 @@ pfx="resolve/main/ggml"
|
|
| 12 |
# get the path of this script
|
| 13 |
function get_script_path() {
|
| 14 |
if [ -x "$(command -v realpath)" ]; then
|
| 15 |
-
echo "$(dirname $(realpath $0))"
|
| 16 |
else
|
| 17 |
local ret="$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)"
|
| 18 |
echo "$ret"
|
|
|
|
| 12 |
# get the path of this script
|
| 13 |
function get_script_path() {
|
| 14 |
if [ -x "$(command -v realpath)" ]; then
|
| 15 |
+
echo "$(dirname "$(realpath "$0")")"
|
| 16 |
else
|
| 17 |
local ret="$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)"
|
| 18 |
echo "$ret"
|