summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2010-05-27 21:15:49 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2010-05-27 21:15:49 +0200
commitafd62976ae0c9242c42b7f62af8d277c4aa1843e (patch)
tree6ce64c218c0de5b3cb1a84c18d5b8b7de9bf01ec
parentAllow for subdirectories. (diff)
downloadGitTools-afd62976ae0c9242c42b7f62af8d277c4aa1843e.tar.xz
GitTools-afd62976ae0c9242c42b7f62af8d277c4aa1843e.zip
Curly braces so we dont spawn a subshell.
-rwxr-xr-xNewProject.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/NewProject.sh b/NewProject.sh
index 4c7d824..856c884 100755
--- a/NewProject.sh
+++ b/NewProject.sh
@@ -33,13 +33,13 @@ echo -n "[*] Creating git ssh wrapper script..."
echo -n 'exec ssh ' >> $gitsshpath &&
echo -n "$options " >> $gitsshpath &&
echo '"$@"' >> $gitsshpath &&
-chmod +x $gitsshpath) || (echo "failure!"; exit 1)
+chmod +x $gitsshpath) || { echo "failure!"; exit 1; }
echo "success."
export GIT_SSH="$gitsshpath"
# Setup control master
echo -n "[*] Connecting to server..."
-ssh $options -fN $connection || (echo "failure!"; exit 1)
+ssh $options -fN $connection || { echo "failure!"; exit 1; }
echo "success."
# Create bare repo on server
@@ -51,7 +51,7 @@ ssh $options $connection "\
git init --bare &&\
echo \"$1\" > description &&\
mv hooks/post-update.sample hooks/post-update &&\
- chmod +x hooks/post-update;" > /dev/null 2>&1 || (echo "failure!"; exit 1)
+ chmod +x hooks/post-update;" > /dev/null 2>&1 || { echo "failure!"; exit 1; }
echo "success."
# Add configuration for remote repo to local repo
@@ -61,18 +61,18 @@ echo "[remote \"origin\"]
fetch = +refs/heads/*:refs/remotes/origin/*
[branch \"master\"]
remote = origin
- merge = refs/heads/master" >> .git/config || (echo "failure!"; exit 1)
+ merge = refs/heads/master" >> .git/config || { echo "failure!"; exit 1; }
echo "success."
# Push local repo to remote repo
echo -n "[*] Uploading repository..."
-git push --all > /dev/null 2>&1 || (echo "failure!"; exit 1)
+git push --all > /dev/null 2>&1 || { echo "failure!"; exit 1; }
echo "success."
# Run the post command if there is one
if [ "$POSTCMD" != "" ]; then
echo -n "[*] Running post-command..."
- ssh $options $connection "$POSTCMD" || (echo "failure!"; exit 1)
+ ssh $options $connection "$POSTCMD" || { echo "failure!"; exit 1; }
echo "success."
fi