Skip to content

Commit 1de0369

Browse files
authored
sanitize VERSION and APPNAME
1 parent 39a6b85 commit 1de0369

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

useful-tools/uruntime2appimage.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,14 @@ _deploy_desktop_and_icon
160160
DESKTOP_ENTRY=$(echo "$APPDIR"/*.desktop)
161161
APPNAME=${APPNAME:-$(awk -F'=' '/^Name=/{gsub(/ /,"_",$2); print $2; exit}' "$DESKTOP_ENTRY")}
162162

163+
# sanitize VERSION and APPNAME
164+
if [ -n "$VERSION" ]; then
165+
VERSION=$(printf '%s' "$VERSION" | tr '":><*|\?\r\n' '_')
166+
fi
167+
if [ -n "$APPNAME" ]; then
168+
APPNAME=$(printf '%s' "$APPNAME" | tr '":><*|\?\r\n' '_')
169+
fi
170+
163171
# add appimage info to desktop entry, first make sure to remove existing info
164172
sed -i \
165173
-e '/X-AppImage-Name/d' \

0 commit comments

Comments
 (0)