mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-15 06:32:40 +00:00
feat: Removes old uninstall-webapp script.
This commit is contained in:
44
env/.local/scripts/uninstall-webapp
vendored
44
env/.local/scripts/uninstall-webapp
vendored
@@ -1,44 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Uninstall's a web app, including it's icon.
|
|
||||||
|
|
||||||
app_dir="$HOME/.local/share/applications"
|
|
||||||
spec=""
|
|
||||||
file=""
|
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]; do
|
|
||||||
if [[ $1 =~ "-f" ]] || [[ $1 =~ "--file" ]]; then
|
|
||||||
shift
|
|
||||||
file=$(jq -r '.name' $1)
|
|
||||||
else
|
|
||||||
file=$1
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
if [[ -z "$file" ]]; then
|
|
||||||
echo -e "Must supplye a web app name to uninstall.\n\n"
|
|
||||||
echo "Usage: uninstall-webapp <name | path>"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
file="$(basename $file)"
|
|
||||||
if [[ ! $file =~ \.desktop$ ]]; then
|
|
||||||
file="$file.desktop"
|
|
||||||
fi
|
|
||||||
|
|
||||||
desktop="$app_dir/$file"
|
|
||||||
|
|
||||||
if [[ ! -f "$desktop" ]]; then
|
|
||||||
echo "No webapp found @: $desktop"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
icon=$(cat $desktop | grep "Icon")
|
|
||||||
icon="${icon/#Icon=/}"
|
|
||||||
|
|
||||||
echo "Removing Application: $desktop"
|
|
||||||
rm -rf "$desktop"
|
|
||||||
|
|
||||||
echo "Removing Icon: $icon"
|
|
||||||
rm -rf "$icon" >/dev/null 2>&1
|
|
||||||
3
webapp
3
webapp
@@ -69,7 +69,7 @@ install() {
|
|||||||
|
|
||||||
uninstall() {
|
uninstall() {
|
||||||
local file=$DEV_ENV/env/webapps/$(basename $1)
|
local file=$DEV_ENV/env/webapps/$(basename $1)
|
||||||
local script="$DEV_ENV/env/.local/scripts/uninstall-webapp"
|
local script="$DEV_ENV/env/.local/scripts/uninstall-desktop-app"
|
||||||
|
|
||||||
if [[ ! -x $script ]]; then
|
if [[ ! -x $script ]]; then
|
||||||
log "Failed to find uninstall web app script."
|
log "Failed to find uninstall web app script."
|
||||||
@@ -88,7 +88,6 @@ uninstall() {
|
|||||||
log "WEBAPP: -- grep: $grep"
|
log "WEBAPP: -- grep: $grep"
|
||||||
|
|
||||||
apps_dir=$(find $DEV_ENV/env/webapps -mindepth 1 -maxdepth 1 -type f)
|
apps_dir=$(find $DEV_ENV/env/webapps -mindepth 1 -maxdepth 1 -type f)
|
||||||
|
|
||||||
for s in $apps_dir; do
|
for s in $apps_dir; do
|
||||||
if basename $s | grep -vq "$grep"; then
|
if basename $s | grep -vq "$grep"; then
|
||||||
log "grep \"$grep\" filtered out $s"
|
log "grep \"$grep\" filtered out $s"
|
||||||
|
|||||||
Reference in New Issue
Block a user