commit e336080e3c2ffc2c748f44312845a50db922f2cd
parent 3dd0aad0492db2121bd960b96407cee5f26b2fe4
Author: andersuno <anders@desk.andersuno.nu>
Date: Wed, 27 Jul 2022 18:34:43 +0200
Added exit in case of cd fail
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-shell-commands/new-repo b/git-shell-commands/new-repo
@@ -3,7 +3,7 @@
[ -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
+cd /git-server/repos/$1.git || exit 1
git init --bare
touch git-daemon-export-ok
echo "$2" > ./description
@@ -14,7 +14,7 @@ echo "find /git-server/repos/ -type d -name \*.git | sort | xargs stagit-index >
chmod +x ./hooks/post-update
mkdir -p /git-server/public-html/$1
-cd /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