Check that directory exists

This commit is contained in:
Bob Mottram 2016-08-15 07:56:52 +01:00
parent 5ec40daaf3
commit cb3266d82f
No known key found for this signature in database
GPG Key ID: 0452CC7CEA982E38
1 changed files with 13 additions and 11 deletions

View File

@ -408,18 +408,10 @@ fi
IPFS_PATH=\$GOPATH/bin IPFS_PATH=\$GOPATH/bin
export PATH="\$GOPATH/bin:\$PATH:" export PATH="\$GOPATH/bin:\$PATH:"
if ! grep -q 'GOPATH/bin' ~/.bashrc; then echo 'export PATH="\$GOPATH/bin:\$PATH:";' >> /home/$MY_USERNAME/.bashrc
echo 'export PATH="\$GOPATH/bin:\$PATH:";' >> ~/.bashrc
else
sed -i "s|systemctl set-environment GOPATH=.*|systemctl set-environment GOPATH=\$GOPATH|g" ~/.bashrc
fi
# set gopath for the user if grep -q 'GOPATH/bin' ~/.bashrc; then
if ! grep -q "GOPATH=" /home/$MY_USERNAME/.bashrc; then sed -i "s|systemctl set-environment GOPATH=.*|systemctl set-environment GOPATH=\$GOPATH|g" ~/.bashrc
echo "export GOPATH=$GOPATH" >> /home/$MY_USERNAME/.bashrc
echo 'export PATH="\$GOPATH/bin:\$PATH:";' >> /home/$MY_USERNAME/.bashrc
else
sed -i "s|export GOPATH=.*|export GOPATH=\$GOPATH|g" /home/$MY_USERNAME/.bashrc
fi fi
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.bashrc chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.bashrc
@ -429,6 +421,11 @@ if [ ! "$?" = "0" ]; then
exit 8242 exit 8242
fi fi
if [ ! -d $GOPATH/src/$IPFS_GO_REPO2 ]; then
echo $'go get failed to get ipfs'
exit 63923
fi
cd \$GOPATH/src/$IPFS_GO_REPO2 cd \$GOPATH/src/$IPFS_GO_REPO2
git checkout $IPFS_COMMIT -b $IPFS_COMMIT git checkout $IPFS_COMMIT -b $IPFS_COMMIT
exit 0 exit 0
@ -521,6 +518,11 @@ function install_ipfs_go {
exit 8242 exit 8242
fi fi
if [ ! -d $GOPATH/src/$IPFS_GO_REPO2 ]; then
echo $'go get failed to get ipfs'
exit 63923
fi
cd $GOPATH/src/$IPFS_GO_REPO2 cd $GOPATH/src/$IPFS_GO_REPO2
git checkout $IPFS_COMMIT -b $IPFS_COMMIT git checkout $IPFS_COMMIT -b $IPFS_COMMIT
if ! grep -q "ipfs commit" $COMPLETION_FILE; then if ! grep -q "ipfs commit" $COMPLETION_FILE; then