Skip to content

Commit a3d8ed5

Browse files
committed
Added in directory validation for --update
1 parent 23e0286 commit a3d8ed5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

support/install_flowbat_ubuntu.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,14 @@ ask() {
3838
if [ "$1" = "--update" ]; then
3939
echo "$(tput setaf 6)This script will install flowbat updates automatically. If it is not up-to-date, it will require a FlowBAT restart.$(tput sgr0)"
4040
if ask "$(tput setaf 3)Are you sure you want to update?$(tput sgr0)"; then
41-
cd "$workingDir"/FlowBAT/
41+
if [ -d "$workingDir/FlowBAT/" ]; then
42+
cd "$workingDir"/FlowBAT/
4243
git pull
4344
exit
45+
else
46+
echo "$(tput setaf 1)There doesn't seem to be a FlowBAT installation located in this directory. Run this script from the location where FlowBAT was installed. Exiting.$(tput sgr0)"
47+
exit 1
48+
fi
4449
else
4550
exit 1
4651
fi

0 commit comments

Comments
 (0)