Fix some minor issues:
- Missing double quote - Replace `echo -n` with `printf "%s"` for more portability and reliability
This commit is contained in:
@@ -28,7 +28,7 @@ source "${0%/*}"/_stack_lib.sh
|
|||||||
function physical_directory_of() {
|
function physical_directory_of() {
|
||||||
local d=$(dirname "$1")
|
local d=$(dirname "$1")
|
||||||
local f=$(basename "$1")
|
local f=$(basename "$1")
|
||||||
(cd "$d" && echo $(pwd -P)"/$f" )
|
(cd "$d" && echo "$(pwd -P)/$f" )
|
||||||
}
|
}
|
||||||
|
|
||||||
# Set REPOBASE to the top of the repository
|
# Set REPOBASE to the top of the repository
|
||||||
@@ -330,10 +330,10 @@ function vcs_relative_path() {
|
|||||||
# Usage: vcs_relative_path file
|
# Usage: vcs_relative_path file
|
||||||
local name="$1"
|
local name="$1"
|
||||||
#python -c 'import os ; print(os.path.relpath("'"$(pwd -P)"'/'"$name"'", "'"$REPOBASE"'"))'
|
#python -c 'import os ; print(os.path.relpath("'"$(pwd -P)"'/'"$name"'", "'"$REPOBASE"'"))'
|
||||||
local p=$( echo -n "$( pwd -P )/${1}" | sed 's#//*#/#g' )
|
local p=$( printf "%s" "$( pwd -P )/${1}" | sed 's#//*#/#g' )
|
||||||
local name="${p#$REPOBASE}"
|
local name="${p#$REPOBASE}"
|
||||||
name=$( echo -n "$name" | sed 's#^/##g' | sed 's#/$##g' )
|
name=$( printf "%s" "$name" | sed 's#^/##g' | sed 's#/$##g' )
|
||||||
echo -n $name
|
printf "%s" "$name"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Removes a line from a text file
|
# Removes a line from a text file
|
||||||
|
|||||||
Reference in New Issue
Block a user