Ver código fonte

Made git usage into arbitrary commands

laptop
= 4 anos atrás
pai
commit
432e94778f
1 arquivos alterados com 7 adições e 17 exclusões
  1. +7
    -17
      util

+ 7
- 17
util Ver arquivo

@@ -1,23 +1,14 @@
#!/bin/sh

pull_backup() {
check_args $# 2
if [ ! -d "$BACKUPS_PATH/$2" ]; then
invalid_path_msg "$1:$2"
return 1;
fi

git -C $BACKUPS_PATH/$2 pull $1
}

push_backup() {
gitcmd() {
#First arg should be the name of the subdirectory, second arg should be command
check_args $# 2
if [ ! -d "$BACKUPS_PATH/$2" ]; then
invalid_path_msg "$1:$2"
if [ ! -d "$BACKUPS_PATH/$1" ]; then
invalid_path_msg "$1"
return 1;
fi

git -C $BACKUPS_PATH/$2 push $1
git -C $BACKUPS_PATH/$1 $2
printf "The command succeded\n"
}

overwrite_local() {
@@ -65,8 +56,7 @@ case "$1" in
;;
overwrite-local) overwrite_local $2 $3;;
overwrite-backup) overwrite_backup $2 $3;;
pull-backup) pull_backup $2 $3;;
push-backup) push_backup $2 $3;;
gitcmd) gitcmd "$2" "$3";;
push-backup) overwrite_backup $2 $3;;
*) printf "No such option\n";;
esac

Carregando…
Cancelar
Salvar