Add more output. Improve installer checking. Handle errors.
This commit is contained in:
parent
81ed0b68bc
commit
3569e23539
56
install.sh
56
install.sh
@ -58,25 +58,52 @@ if [ "$1" == "uninstall" ]; then
|
|||||||
echo
|
echo
|
||||||
exit $end_ret
|
exit $end_ret
|
||||||
fi
|
fi
|
||||||
if [ ! -d zbstudio ]; then
|
printf "* checking installer..."
|
||||||
cd "${0%/*}"
|
good_src_flag="zbstudio/interpreters/minetest.lua"
|
||||||
echo "WARNING: had to change directory to `pwd` since zbstudio patch directory was not found..."
|
#if [ ! -d zbstudio ]; then
|
||||||
fi
|
# cd "${0%/*}"
|
||||||
if [ ! -d zbstudio ]; then
|
# if [ -f "$good_src_flag" ]; then
|
||||||
echo "ERROR: Nothing done since missing zbstudio patch--you must run this installer from the MinetestIDE directory containing the zbstudio patch directory."
|
# echo "WARNING: had to change directory to `pwd` since zbstudio patch directory was not found..."
|
||||||
|
# fi
|
||||||
|
#fi
|
||||||
|
if [ ! -f "$good_src_flag" ]; then
|
||||||
|
echo "ERROR: Nothing done since missing zbstudio patch--you must run this installer from the MinetestIDE directory containing \"$good_src_flag\"."
|
||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
echo "OK (found \"$good_src_flag\" in \"`pwd`\")"
|
||||||
mi_path="`pwd`"
|
mi_path="`pwd`"
|
||||||
end_msg=""
|
end_msg=""
|
||||||
if [ ! -d "$zs_dest" ]; then
|
if [ ! -d "$zs_dest" ]; then
|
||||||
if [ ! -d "$HOME/Downloads" ]; then mkdir -p "$HOME/Downloads"; fi
|
echo "* installing zbstudio to $zs_dest..."
|
||||||
|
if [ ! -d "$HOME/Downloads" ]; then
|
||||||
|
mkdir -p "$HOME/Downloads"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Error: 'mkdir -p \"$HOME/Downloads\"' failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
cd "$HOME/Downloads"
|
cd "$HOME/Downloads"
|
||||||
dl_name=ZeroBraneStudioEduPack-1.80-linux.sh
|
dl_name=ZeroBraneStudioEduPack-1.80-linux.sh
|
||||||
|
URL=https://download.zerobrane.com/$dl_name
|
||||||
if [ ! -f "$dl_name" ]; then
|
if [ ! -f "$dl_name" ]; then
|
||||||
wget -O $dl_name https://download.zerobrane.com/$dl_name
|
if [ ! -f "`command -v wget`" ]; then
|
||||||
|
echo "Error: This script requires wget unless \"$dl_name\" is in \"`pwd`\"."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "* downloading $URL..."
|
||||||
|
wget -O $dl_name $URL
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Error: 'wget -O $dl_name $URL' failed in \"`pwd`\""
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "* running '$dl_name' in \"`pwd`\"..."
|
||||||
sh $dl_name
|
sh $dl_name
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Error: 'sh $dl_name' failed in \"`pwd`\""
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
if [ ! -d "$zs_dest" ]; then
|
if [ ! -d "$zs_dest" ]; then
|
||||||
echo "ERROR: MinetestIDE not installed since failed to install $zs_dest"
|
echo "ERROR: MinetestIDE not installed since failed to install $zs_dest"
|
||||||
echo
|
echo
|
||||||
@ -85,6 +112,8 @@ if [ ! -d "$zs_dest" ]; then
|
|||||||
fi
|
fi
|
||||||
end_msg="If you paid for ZeroBrane Studio, thank you for your contribution. If you have not, please consider supporting the project <https://studio.zerobrane.com/support>."
|
end_msg="If you paid for ZeroBrane Studio, thank you for your contribution. If you have not, please consider supporting the project <https://studio.zerobrane.com/support>."
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "* detected $zs_dest"
|
||||||
fi
|
fi
|
||||||
if [ ! -d "$zs_dest" ]; then
|
if [ ! -d "$zs_dest" ]; then
|
||||||
echo "ERROR: nothing done since missing $zs_dest."
|
echo "ERROR: nothing done since missing $zs_dest."
|
||||||
@ -92,6 +121,10 @@ if [ ! -d "$zs_dest" ]; then
|
|||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
cd "$mi_path"
|
cd "$mi_path"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Error: 'cd \"$mi_path\"' failed in \"`pwd`\""
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
if [ ! -f "`command -v rsync`" ]; then
|
if [ ! -f "`command -v rsync`" ]; then
|
||||||
#echo "ERROR: Nothing done since rsync is required."
|
#echo "ERROR: Nothing done since rsync is required."
|
||||||
#exit 5
|
#exit 5
|
||||||
@ -113,7 +146,14 @@ if [ ! -f "`command -v rsync`" ]; then
|
|||||||
fi
|
fi
|
||||||
echo "Successfully installed. See README for manual steps needed in GUI."
|
echo "Successfully installed. See README for manual steps needed in GUI."
|
||||||
else
|
else
|
||||||
|
printf "* installing patches to \"$zs_dest\"..."
|
||||||
sudo rsync -rt zbstudio/ $zs_dest
|
sudo rsync -rt zbstudio/ $zs_dest
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "FAILED"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "OK"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
echo "$end_msg"
|
echo "$end_msg"
|
||||||
echo
|
echo
|
||||||
|
Loading…
x
Reference in New Issue
Block a user