fix: Fixes webapp install scripts to handle 'null' values in json specs

This commit is contained in:
2025-09-28 17:44:54 -04:00
parent c6a0056ad6
commit a05e8f41bd
2 changed files with 4 additions and 4 deletions

View File

@@ -121,7 +121,7 @@ else
fi
# Use custom exec if provided, otherwise default behavior
if [[ -n $CUSTOM_EXEC ]]; then
if [[ -n $CUSTOM_EXEC ]] && [[ ! $CUSTOM_EXEC == "null" ]]; then
EXEC_COMMAND="$CUSTOM_EXEC"
else
EXEC_COMMAND="${SCRIPTS:-$HOME/.local/scripts}/launch-webapp $APP_URL"
@@ -143,7 +143,7 @@ StartupNotify=true
EOF
# Add mime types if provided
if [[ -n $MIME_TYPES ]]; then
if [[ -n $MIME_TYPES ]] && [[ ! $MIME_TYPES == "null" ]]; then
echo "MimeType=$MIME_TYPES" >>"$DESKTOP_FILE"
fi

4
webapp
View File

@@ -57,7 +57,7 @@ install() {
# Install local icons if needed
mkdir -p $XDG_DATA_HOME/applications/icons
for i in $(find $script_dir/assets/icons -mindepth 1 -maxdepth 1 -type f); do
if [[ ! -f $XDG_DATA_HOME/applications/icons/$i ] && [ $dry_run == "0" ]]; then
if [[ ! -f $XDG_DATA_HOME/applications/icons/$i ]] && [[ $dry_run == "0" ]]; then
cp $i $XDG_DATA_HOME/applications/icons
fi
done
@@ -70,7 +70,7 @@ install() {
--url $(echo $file | jq -r '.url') \
--icon $(echo $file | jq -r '.icon') \
--exec $(echo $file | jq -r '.exec') \
--mime $(echo $file | jq -r '.mime')
--mime-types $(echo $file | jq -r '.mime_types')
fi
}