This commit is contained in:
madmaurice 2015-10-08 09:21:06 +02:00
parent 4071563a9c
commit 1085378130

View file

@ -26,21 +26,31 @@ command_add() {
ln -s "$DOTFILES_DIR/$savepoint" "$file" ln -s "$DOTFILES_DIR/$savepoint" "$file"
cd $DOTFILES_DIR cd $DOTFILES_DIR
git add "$savepoint" git add "$savepoint"
git commit -m "Added $savepoint"
echo "$file added in $DOTFILES_DIR/$savepoint" echo "$file added in $DOTFILES_DIR/$savepoint"
} }
command_echo() { command_sync() {
echo Dotfiles echo: $@ 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 CMD=$1
shift shift
case "$CMD" in case "$CMD" in
diff|commit|add|echo|status) diff|commit|add|status|sync|help)
command_$CMD $@ command_$CMD $@
;; ;;
*) *)
echo "Command $CMD not found." command_help
;; ;;
esac esac