Skip to content

Commit

Permalink
Display a more user friendly error if script isn't ran as root. symlink.
Browse files Browse the repository at this point in the history
  • Loading branch information
2E0PGS authored and facchinm committed Mar 7, 2019
1 parent 4cd38aa commit 702976f
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions build/linux/dist/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ xdg_install_f() {

# Add symlink for arduino so it's in users path
echo "" # Ensure password request message is on new line
sudo ln -s ${SCRIPT_PATH}/arduino /usr/local/bin/arduino
if ! ln -s ${SCRIPT_PATH}/arduino /usr/local/bin/arduino; then
echo "Adding symlink failed. Hope that's OK. If not then rerun as root with sudo."
fi

# Clean up
rm "${TMP_DIR}/${RESOURCE_NAME}.desktop"
Expand Down Expand Up @@ -104,7 +106,9 @@ simple_install_f() {

# Add symlink for arduino so it's in users path
echo "" # Ensure password request message is on new line
sudo ln -s ${SCRIPT_PATH}/arduino /usr/local/bin/arduino
if ! ln -s ${SCRIPT_PATH}/arduino /usr/local/bin/arduino; then
echo "Adding symlink failed. Hope that's OK. If not then rerun as root with sudo."
fi

# Clean up temp dir
rm "${TMP_DIR}/${RESOURCE_NAME}.desktop"
Expand Down Expand Up @@ -148,7 +152,9 @@ xdg_uninstall_f() {

# Remove symlink for arduino
echo "" # Ensure password request message is on new line
sudo rm /usr/local/bin/arduino
if ! rm /usr/local/bin/arduino; then
echo "Removing symlink failed. Hope that's OK. If not then rerun as root with sudo."
fi

}

Expand Down Expand Up @@ -183,7 +189,9 @@ simple_uninstall_f() {

# Remove symlink for arduino
echo "" # Ensure password request message is on new line
sudo rm /usr/local/bin/arduino
if ! rm /usr/local/bin/arduino; then
echo "Removing symlink failed. Hope that's OK. If not then rerun as root with sudo."
fi

}

Expand Down

0 comments on commit 702976f

Please sign in to comment.