commit 5a18ec7b611c0ec2d5550418bbb5f6d9e99e5d39 parent e336080e3c2ffc2c748f44312845a50db922f2cd Author: andersuno <anders@desk.andersuno.nu> Date: Wed, 3 Aug 2022 20:12:27 +0200 Quoted vars Diffstat:
M | git-shell-commands/new-repo | | | 12 | ++++++------ |
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/git-shell-commands/new-repo b/git-shell-commands/new-repo @@ -1,9 +1,9 @@ #!/bin/sh -[ -z $1 ] && echo "No name provided" && echo "new-repo <name> <desc>" && exit 1 -[ -z $2 ] && echo "No description provided" && echo "new-repo <name> <desc>" && exit 1 +[ -z "$1" ] && echo "No name provided" && echo "new-repo <name> <desc>" && exit 1 +[ -z "$2" ] && echo "No description provided" && echo "new-repo <name> <desc>" && exit 1 -mkdir -p /git-server/repos/$1.git -cd /git-server/repos/$1.git || exit 1 +mkdir -p /git-server/repos/"$1".git +cd /git-server/repos/"$1".git || exit 1 git init --bare touch git-daemon-export-ok echo "$2" > ./description @@ -13,8 +13,8 @@ echo "cd /git-server/public-html/$1 && stagit /git-server/repos/$1.git" > ./hook echo "find /git-server/repos/ -type d -name \*.git | sort | xargs stagit-index > /git-server/public-html/index.html" >> ./hooks/post-update chmod +x ./hooks/post-update -mkdir -p /git-server/public-html/$1 -cd /git-server/public-html/$1 || exit 1 +mkdir -p /git-server/public-html/"$1" +cd /git-server/public-html/"$1" || exit 1 ln -sf ../favicon.png favicon.png ln -sf ../logo.png logo.png ln -sf ../style.css style.css