2021-07-15 00:22:16 +00:00
|
|
|
function dotfish
|
|
|
|
if test (count $argv) -ge 1
|
|
|
|
set -g TARGET $argv[1]
|
|
|
|
else
|
|
|
|
set -g TARGET (whoami)
|
|
|
|
end
|
2021-07-15 00:23:11 +00:00
|
|
|
set -g FISHCONFIG ~(echo $TARGET)/.config/fish
|
2021-07-15 00:22:16 +00:00
|
|
|
|
|
|
|
echo_progress "Updating fish config for: "
|
|
|
|
echo_highlight "$TARGET" \n
|
|
|
|
|
2021-07-15 00:27:19 +00:00
|
|
|
if test -d $FISHCONFIG
|
|
|
|
echo_progress "Pulling from Git..." \n
|
|
|
|
git -C $FISHCONFIG pull
|
|
|
|
else
|
|
|
|
echo_progress "Cloning from Git..." \n
|
|
|
|
git clone "https://github.com/Steffo99/.config-fish" $FISHCONFIG
|
|
|
|
end
|
2021-07-15 00:22:16 +00:00
|
|
|
|
|
|
|
echo_progress "Fixing permissions..." \n
|
2021-07-15 00:23:11 +00:00
|
|
|
chown -R "$TARGET:" $FISHCONFIG
|
2021-07-15 00:22:16 +00:00
|
|
|
|
|
|
|
echo_progress "Update complete!"
|
|
|
|
end
|