mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2024-12-19 20:57:52 +00:00
models : handle spaces and special characters in shell script paths (#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.
This commit is contained in:
parent
0f759f125d
commit
18e6fb0287
@ -12,7 +12,7 @@ pfx="resolve/main/ggml"
|
|||||||
# get the path of this script
|
# get the path of this script
|
||||||
function get_script_path() {
|
function get_script_path() {
|
||||||
if [ -x "$(command -v realpath)" ]; then
|
if [ -x "$(command -v realpath)" ]; then
|
||||||
echo "$(dirname $(realpath $0))"
|
echo "$(dirname "$(realpath "$0")")"
|
||||||
else
|
else
|
||||||
local ret="$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)"
|
local ret="$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)"
|
||||||
echo "$ret"
|
echo "$ret"
|
||||||
|
Loading…
Reference in New Issue
Block a user