2024-01-09 15:48:11 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2024-01-12 01:55:39 +00:00
|
|
|
action=${action:?}
|
|
|
|
|
|
|
|
# if action is run or completions, do nothing
|
|
|
|
if [ "$action" = "run" ] || [ "$action" = "completions" ]
|
2024-01-09 15:48:11 +00:00
|
|
|
then
|
2024-01-12 02:14:51 +00:00
|
|
|
return
|
2024-01-09 15:48:11 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
clean=${args[--clean]:-}
|
|
|
|
target=${args[target]:?}
|
|
|
|
|
2024-01-12 01:55:39 +00:00
|
|
|
if [ "$action" = "exe" ]
|
2024-01-09 15:48:11 +00:00
|
|
|
then
|
|
|
|
target="$HOME/.local/bin/$target"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "$clean" ] || [ -n "${AUTOINSTALL_CLEAN:-}" ]
|
|
|
|
then
|
|
|
|
echo "Cleaning $target"
|
|
|
|
rm -rf "$target"
|
|
|
|
fi
|