b#67 install.sh for linux is broken
MODIFY
builder/scripts/install.sh
builder/scripts/install.sh
@@ -15,12 +15,6 @@ SCRIPT_PATH=$( cd $(dirname $0) ; pwd )
cd "${SCRIPT_PATH}"
export PATH=.:$PATH
-platform='linux'
-unamestr=`uname`
-if [[ "$unamestr" == 'Darwin' ]]; then
- platform='darwin'
-fi
-
# Default mode is to install.
UNINSTALL=false
@@ -37,14 +31,12 @@ install_files() {
printf "If you have more then one Java version installed\n"
printf "you need to identify what directory has Java 8.\n"
printf "You can exit this script with ^c and use this command to find it.\n\n"
- if [[ $platform == 'linux' ]]; then
+
printf "sudo update-alternatives --config java \n\n"
printf "If Arduino IDE is installed you can use the Arduino built in Java\n"
- printf "Example:\n"
+ printf "Examples:\n"
+ printf "/usr/lib/jvm/java-8-openjdk-amd64/jre\n"
printf "$HOME/arduino-1.8.7/java\n\n"
- else
- printf "/usr/libexec/java_home -v 1.8 \n\n"
- fi
# Ask user where we can find Java - loop until a valid answer is given
JAVA_PATH=""
@@ -70,7 +62,6 @@ install_files() {
chmod +x "${SCRIPT_PATH}/GUIslice.sh"
- if [[ $platform == 'linux' ]]; then
# Create a temp folder for the install
mkdir tmp
@@ -88,14 +79,12 @@ install_files() {
# Clean up temp dir
rm "${SCRIPT_PATH}/tmp/guislice.desktop"
rmdir "${SCRIPT_PATH}/tmp"
- fi
printf "Install Completed!\n"
}
# Uninstall by simply removing desktop files
uninstall_files() {
- if [[ $platform == 'linux' ]]; then
printf "Removing desktop shortcut for GUIsliceBuilder\n"
if [ -f "${SCRIPT_PATH}/GUIslice.sh" ]; then
rm "${SCRIPT_PATH}/GUIslice.sh"
@@ -105,9 +94,6 @@ uninstall_files() {
rm "${HOME}/Desktop/guislice.desktop"
fi
printf "Uninstall Completed!\n"
- else
- printf "Can't Uninstall on OS/X you need to move app to trash!\n"
- fi
}
# Check for provided arguments
@@ -130,6 +116,7 @@ done
if [ ${UNINSTALL} = true ]; then
uninstall_files
else
+ uninstall_files
install_files
fi

b#67 install.sh for linux is broken