@@ -68,7 +68,9 @@ xdg_install_f() {
68
68
69
69
# Add symlink for arduino so it's in users path
70
70
echo " " # Ensure password request message is on new line
71
- sudo ln -s ${SCRIPT_PATH} /arduino /usr/local/bin/arduino
71
+ if ! ln -s ${SCRIPT_PATH} /arduino /usr/local/bin/arduino; then
72
+ echo " Adding symlink failed. Hope that's OK. If not then rerun as root with sudo."
73
+ fi
72
74
73
75
# Clean up
74
76
rm " ${TMP_DIR} /${RESOURCE_NAME} .desktop"
@@ -104,7 +106,9 @@ simple_install_f() {
104
106
105
107
# Add symlink for arduino so it's in users path
106
108
echo " " # Ensure password request message is on new line
107
- sudo ln -s ${SCRIPT_PATH} /arduino /usr/local/bin/arduino
109
+ if ! ln -s ${SCRIPT_PATH} /arduino /usr/local/bin/arduino; then
110
+ echo " Adding symlink failed. Hope that's OK. If not then rerun as root with sudo."
111
+ fi
108
112
109
113
# Clean up temp dir
110
114
rm " ${TMP_DIR} /${RESOURCE_NAME} .desktop"
@@ -148,7 +152,9 @@ xdg_uninstall_f() {
148
152
149
153
# Remove symlink for arduino
150
154
echo " " # Ensure password request message is on new line
151
- sudo rm /usr/local/bin/arduino
155
+ if ! rm /usr/local/bin/arduino; then
156
+ echo " Removing symlink failed. Hope that's OK. If not then rerun as root with sudo."
157
+ fi
152
158
153
159
}
154
160
@@ -183,7 +189,9 @@ simple_uninstall_f() {
183
189
184
190
# Remove symlink for arduino
185
191
echo " " # Ensure password request message is on new line
186
- sudo rm /usr/local/bin/arduino
192
+ if ! rm /usr/local/bin/arduino; then
193
+ echo " Removing symlink failed. Hope that's OK. If not then rerun as root with sudo."
194
+ fi
187
195
188
196
}
189
197
0 commit comments