X-Git-Url: http://git.sven.stormbind.net/?p=sven%2Fscripts.git;a=blobdiff_plain;f=home%2Fmpass.sh;h=7cc3a9c8fad4169e562315814664ec509fa4baf3;hp=8d88b6d7735cc35989d351e726d83b6647aabbc7;hb=ed66192568f06127d0a6ab589bdeec0b273c5363;hpb=8747c72b953e5eadf25677e1d0bb9003bfcdc211 diff --git a/home/mpass.sh b/home/mpass.sh index 8d88b6d..7cc3a9c 100755 --- a/home/mpass.sh +++ b/home/mpass.sh @@ -25,8 +25,8 @@ function help { Commands: - pull: executes a "git pull" in the configured REPO_STORE_DIR[reponame] - push: executes a "git push" in the configured REPO_STORE_DIR[reponame] + pull: executes a "pass git pull --all" for the selected pass repo + push: executes a "pass git push --all" for the selected pass repo EOF exit 42 @@ -82,33 +82,20 @@ while getopts ":r:" option; do esac done -if [[ -z "${@}" ]]; then - echo "ERROR: no commands given" >&2 - help -fi -# read our configuration initialize -case $1 in +command=${1:-} +case $command in pull) echo "Trying to update pass repo ${PASSWORD_STORE_DIR}" - cd ${PASSWORD_STORE_DIR} - set +e - git pull - set -e - cd - + pass git pull --all ;; push) echo "Trying to push pass repo ${PASSWORD_STORE_DIR}" - cd ${PASSWORD_STORE_DIR} - set +e - git push - set -e - cd - + pass git push --all ;; *) - echo "Remaining pass commands: $@" pass ${@} ;; esac