aboutsummaryrefslogtreecommitdiff
path: root/pw
diff options
context:
space:
mode:
authorAnirudh Oppiliappan <x@icyphox.sh>2021-09-22 11:49:11 +0530
committerAnirudh Oppiliappan <x@icyphox.sh>2021-09-22 11:49:11 +0530
commit2b87c05c6e3773f299a566323756fac133cab6bc (patch)
tree18cc3885b355f1a6b4dd9fdf7c075b2a4770c92e /pw
parentf4ab00e5ac6fc80bc9a3d852ec521f1f208dbf42 (diff)
downloadpw-2b87c05c6e3773f299a566323756fac133cab6bc.tar.gz
Commit and push
Diffstat (limited to 'pw')
-rwxr-xr-xpw11
1 files changed, 10 insertions, 1 deletions
diff --git a/pw b/pw
index 4205630..0f541ae 100755
--- a/pw
+++ b/pw
@@ -37,8 +37,17 @@ add() {
37 printf "%s" "$pass" | "$gpg" -aer "$PW_KEY" -o "$PW_DIR/$1.gpg" 37 printf "%s" "$pass" | "$gpg" -aer "$PW_KEY" -o "$PW_DIR/$1.gpg"
38 printf "pw: %s/%s.gpg created\n" "$PW_DIR" "$1" 38 printf "pw: %s/%s.gpg created\n" "$PW_DIR" "$1"
39 else 39 else
40 die "the file %s/%s.gpg exists" "$PW_DIR" "$1" 40 die "the file $PW_DIR/$1.gpg exists"
41 fi 41 fi
42 (
43 cd $PW_DIR
44 git add .
45 git commit -m "$(date)"
46 remote="$(git remote show)"
47 branch="$(git branch --show-current)"
48 git pull -r "$remote" "$branch"
49 git push "$remote" "$branch"
50 )
42} 51}
43 52
44list() { 53list() {