echo"WARNING: found incorrectly installed file $bad_file, so removing..."
sudo rm -f "$bad_file"
sudo rmdir "$zs_dest/api/lua"
sudo rmdir "$zs_dest/api"
if[ -f "$bad_file"];then
echo"ERROR: Failed to remove $bad_file"
end_msg="Uninstall FAILED."
end_ret=1
fi
fi
if[ -f "$dest_file"];then
sudo rm -f "$dest_file"
sudo rmdir "$zs_dest/zbstudio/api/lua"
sudo rmdir "$zs_dest/zbstudio/api"
fi
if[ -f "$dest_file"];then
echo"ERROR: could not remove $dest_file"
echo
echo
end_msg="Uninstall FAILED."
end_ret=1
fi
echo"$end_msg"
echo
echo
exit$end_ret
fi
if[ ! -d zbstudio ];then
cd"${0%/*}"
echo"WARNING: had to change directory to `pwd` since zbstudio patch directory was not found..."
fi
if[ ! -d zbstudio ];then
echo"ERROR: Nothing done since missing zbstudio patch--you must run this installer from the MinetestIDE directory containing the zbstudio patch directory."
echo"ERROR: MinetestIDE not installed since failed to install $zs_dest"
echo
echo
exit2
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>."