Skip to content

Commit 3f51b39

Browse files
committed
Add install of appdata for xdg_install_f
This adds the installation of appdata.xml for xdg_install_f() and corresponding remove in xdg_uninstall_f() for completeness. Also removes unnecessary echo that is no longer required as commands no longer have sudo - see 702976f
1 parent 43b0818 commit 3f51b39

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

build/linux/dist/install.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ xdg_install_f() {
5252
# Install Arduino mime type
5353
xdg-mime install "${SCRIPT_PATH}/lib/${RESOURCE_NAME}.xml"
5454

55+
mkdir -p "${HOME}/.local/share/metainfo"
56+
cp "${SCRIPT_PATH}/appdata.xml" "${HOME}/.local/share/metainfo/${RESOURCE_NAME}.appdata.xml"
57+
5558
# Install icons for mime type
5659
xdg-icon-resource install --context mimetypes --size 16 "${SCRIPT_PATH}/lib/icons/16x16/apps/arduino.png" text-x-arduino
5760
xdg-icon-resource install --context mimetypes --size 24 "${SCRIPT_PATH}/lib/icons/24x24/apps/arduino.png" text-x-arduino
@@ -71,7 +74,6 @@ xdg_install_f() {
7174
fi
7275

7376
# Add symlink for arduino so it's in users path
74-
echo "" # Ensure password request message is on new line
7577
if ! ln -s ${SCRIPT_PATH}/arduino /usr/local/bin/arduino; then
7678
echo "Adding symlink failed. Hope that's OK. If not then rerun as root with sudo."
7779
fi
@@ -112,7 +114,6 @@ simple_install_f() {
112114
fi
113115

114116
# Add symlink for arduino so it's in users path
115-
echo "" # Ensure password request message is on new line
116117
if ! ln -s ${SCRIPT_PATH}/arduino /usr/local/bin/arduino; then
117118
echo "Adding symlink failed. Hope that's OK. If not then rerun as root with sudo."
118119
fi
@@ -157,8 +158,11 @@ xdg_uninstall_f() {
157158
# Remove Arduino MIME type
158159
xdg-mime uninstall "${SCRIPT_PATH}/lib/${RESOURCE_NAME}.xml"
159160

161+
if [ -f "${HOME}/.local/share/metainfo/${RESOURCE_NAME}.appdata.xml" ]; then
162+
rm "${HOME}/.local/share/metainfo/${RESOURCE_NAME}.appdata.xml"
163+
fi
164+
160165
# Remove symlink for arduino
161-
echo "" # Ensure password request message is on new line
162166
if [ -f /usr/local/bin/arduino ]; then
163167
rm /usr/local/bin/arduino || echo "Removing symlink failed. Hope that's OK. If not then rerun as root with sudo."
164168
fi
@@ -195,7 +199,6 @@ simple_uninstall_f() {
195199
fi
196200

197201
# Remove symlink for arduino
198-
echo "" # Ensure password request message is on new line
199202
if [ -f /usr/local/bin/arduino ]; then
200203
rm /usr/local/bin/arduino || echo "Removing symlink failed. Hope that's OK. If not then rerun as root with sudo."
201204
fi

0 commit comments

Comments
 (0)