diff --git a/scripts/dotfiles.sh b/scripts/dotfiles.sh index 78c7ceb..7bd06fb 100755 --- a/scripts/dotfiles.sh +++ b/scripts/dotfiles.sh @@ -26,21 +26,31 @@ command_add() { ln -s "$DOTFILES_DIR/$savepoint" "$file" cd $DOTFILES_DIR git add "$savepoint" + git commit -m "Added $savepoint" echo "$file added in $DOTFILES_DIR/$savepoint" } -command_echo() { - echo Dotfiles echo: $@ +command_sync() { + cd $DOTFILES_DIR + git push; git pull +} + +command_help() { + echo "diff -- Show diffs" + echo "commit [message] -- Add all files and commit" + echo "status -- Show status" + echo "add [file] [savepoint] -- Add file to dotfiles at savepoint, create symlink and add" + echo "sync -- push and pull" } CMD=$1 shift case "$CMD" in - diff|commit|add|echo|status) + diff|commit|add|status|sync|help) command_$CMD $@ ;; *) - echo "Command $CMD not found." + command_help ;; esac