Skip to content

Symlink the arduino binary #7593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions build/linux/dist/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ xdg_install_f() {
# Make Arduino IDE the default application for *.ino
xdg-mime default ${RESOURCE_NAME}.desktop text/x-arduino

# Add symlink for arduino so it's in users path
echo "" # Ensure password request message is on new line
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"
rmdir "$TMP_DIR"
Expand Down Expand Up @@ -98,6 +104,12 @@ simple_install_f() {
chmod u+x "${XDG_DESKTOP_DIR}/${RESOURCE_NAME}.desktop"
fi

# Add symlink for arduino so it's in users path
echo "" # Ensure password request message is on new line
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"
rmdir "${TMP_DIR}"
Expand Down Expand Up @@ -138,6 +150,12 @@ xdg_uninstall_f() {
# Remove Arduino MIME type
xdg-mime uninstall "${SCRIPT_PATH}/lib/${RESOURCE_NAME}.xml"

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

}

# Uninstall by simply removing desktop files (fallback), incl. old one
Expand Down Expand Up @@ -169,6 +187,12 @@ simple_uninstall_f() {
rm "${XDG_DESKTOP_DIR}/${RESOURCE_NAME}.desktop"
fi

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

}

# Update desktop file and mime databases (if possible)
Expand Down