1
Fork 0
mirror of https://github.com/Steffo99/config-fish.git synced 2024-12-22 06:44:22 +00:00

Fix dotfish permissions thingy

This commit is contained in:
Steffo 2024-09-03 01:38:16 +02:00
parent 6c4f17a5a4
commit e9395c3787
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0

View file

@ -21,19 +21,19 @@ function dotfish
log-t "Deletion rejected, not touching" "$FISHCONFIG" "."
continue
end
end
if test -d "$FISHCONFIG"
log-t "Existing config detected at" "$FISHCONFIG" "pulling from Git..."
command git -C "$FISHCONFIG" pull
else
log-t "No config detected, cloning from Git into" "$FISHCONFIG" "..."
command git clone "https://github.com/Steffo99/.config-fish" "$FISHCONFIG"
end
log-t "Fixing permissions at" "$FISHCONFIG" "..."
command chown -R "$TARGET:" "$FISHCONFIG"
if test -d "$FISHCONFIG"
log-t "Existing config detected at" "$FISHCONFIG" "pulling from Git..."
command sudo -u "$TARGET" -- git -C "$FISHCONFIG" pull
else
log-t "No config detected, cloning from Git into" "$FISHCONFIG" "..."
command sudo -u "$TARGET" -- git clone "https://github.com/Steffo99/.config-fish" "$FISHCONFIG"
end
log-t "Changing login shell to" "/usr/bin/fish" "..."
command chsh -s "/usr/bin/fish" "$TARGET"
end