From 108537813029ddfe9312c1ab1225e7f1fc835fdd Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Thu, 8 Oct 2015 09:21:06 +0200 Subject: [PATCH] Added --- scripts/dotfiles.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) 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