feat: Adds functionality to use a json file for install or uninstall webapp scripts.

This commit is contained in:
2025-09-28 18:57:56 -04:00
parent a05e8f41bd
commit 1a3442dee7
3 changed files with 46 additions and 12 deletions

12
webapp
View File

@@ -46,7 +46,7 @@ log() {
}
install() {
local file=$(cat $1)
local file=$1
local script="${script_dir}/env/.local/scripts/install-webapp"
if [[ ! -x $script ]]; then
@@ -65,17 +65,11 @@ install() {
log "Installing webapp from spec: $1"
if [[ $dry_run == "0" ]]; then
$script \
--name $(echo $file | jq -r '.name') \
--url $(echo $file | jq -r '.url') \
--icon $(echo $file | jq -r '.icon') \
--exec $(echo $file | jq -r '.exec') \
--mime-types $(echo $file | jq -r '.mime_types')
$script --file $file
fi
}
uninstall() {
local file=$(cat $1)
local script="${script_dir}/env/.local/scripts/uninstall-webapp"
if [[ ! -x $script ]]; then
@@ -86,7 +80,7 @@ uninstall() {
log "Uninstalling webapp from spec: $1"
if [[ $dry_run == "0" ]]; then
$script $(echo $file | jq -r '.name')
$script --file $1
fi
}