use double quotes and $() notation

This commit is contained in:
Kalamatee 2021-01-09 15:55:30 +00:00 committed by deadwood
parent 6220c541ca
commit ffd301fc7e
2 changed files with 6 additions and 6 deletions

View File

@ -3,13 +3,13 @@
# get repository revision via svn or via git
#
inside_git_repo=`cd $1 && git rev-parse --is-inside-work-tree 2>/dev/null`
inside_git_repo=$(cd "$1" && git rev-parse --is-inside-work-tree 2>/dev/null)
if test -d $1/.svn; then
svn info $1 | sed -n 's/Revision: //p'
if test -d "$1/.svn"; then
svn info "$1" | sed -n 's/Revision: //p'
else
if [ "$inside_git_repo" = "true" ]; then
cd $1
cd "$1"
git rev-parse --short HEAD
else
echo "NoRev"

View File

@ -3,9 +3,9 @@
# get repository type
#
inside_git_repo=`cd $1 && git rev-parse --is-inside-work-tree 2>/dev/null`
inside_git_repo=$(cd "$1" && git rev-parse --is-inside-work-tree 2>/dev/null)
if test -d $1/.svn; then
if test -d "$1/.svn"; then
echo "SVN"
else
if [ "$inside_git_repo" = "true" ]; then