소스 검색

Made git usage into arbitrary commands

laptop
= 4 년 전
부모
커밋
432e94778f
1개의 변경된 파일7개의 추가작업 그리고 17개의 파일을 삭제
  1. +7
    -17
      util

+ 7
- 17
util 파일 보기

@@ -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

불러오는 중...
취소
저장