After gemini-propoesed fixes

This commit is contained in:
Sam Hardeman 2026-03-13 01:38:34 +01:00
parent 2e31283b61
commit 83324dd0f7
11 changed files with 228 additions and 307 deletions

18
own
View file

@ -5,13 +5,19 @@
LD_INTERNAL=1
. $(dirname $(realpath $0))/daisy.source
if [[ $@ == '' ]];
then
echo "$LD_BIN: Used to quickly take ownership of files/folders."
echo "Requires sudo. If sudo is not installed, this tool will fai."
if [[ -z "$1" ]]; then
echo "$LD_BIN: Quickly take ownership of files/folders."
echo "Usage: $LD_BIN <folders or files>"
echo "Means: chown -R <youruser>:<youruser> <folders or files>"
echo "Requires sudo. If sudo is not installed, this tool will fail."
exit 2
fi
sudo chown -R $(whoami):$(whoami) "$@" 1>/dev/null 2>/dev/null
# Ensure all arguments exist before attempting chown
for target in "$@"; do
if [[ ! -e "$target" ]]; then
echo "Error: \"$target\" does not exist."
exit 1
fi
done
sudo chown -R "$(whoami):$(whoami)" "$@"