Added
This commit is contained in:
parent
4071563a9c
commit
1085378130
1 changed files with 14 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue