mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-13 22:02:34 +00:00
feat: Adds functionality to use a json file for install or uninstall webapp scripts.
This commit is contained in:
12
webapp
12
webapp
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user