tools/autoinstall/before.sh

24 lines
387 B
Bash
Raw Normal View History

2024-01-09 15:48:11 +00:00
#!/usr/bin/env bash
action=${action:?}
# if action is run or completions, do nothing
if [ "$action" = "run" ] || [ "$action" = "completions" ]
2024-01-09 15:48:11 +00:00
then
return
2024-01-09 15:48:11 +00:00
fi
clean=${args[--clean]:-}
target=${args[target]:?}
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