Commit and push
Anirudh Oppiliappan x@icyphox.sh
Wed, 22 Sep 2021 11:49:11 +0530
1 files changed,
10 insertions(+),
1 deletions(-)
jump to
M
pw
→
pw
@@ -37,8 +37,17 @@ if [[ ! -f "$PW_DIR/$1.gpg" ]]; then
printf "%s" "$pass" | "$gpg" -aer "$PW_KEY" -o "$PW_DIR/$1.gpg" printf "pw: %s/%s.gpg created\n" "$PW_DIR" "$1" else - die "the file %s/%s.gpg exists" "$PW_DIR" "$1" + die "the file $PW_DIR/$1.gpg exists" fi + ( + cd $PW_DIR + git add . + git commit -m "$(date)" + remote="$(git remote show)" + branch="$(git branch --show-current)" + git pull -r "$remote" "$branch" + git push "$remote" "$branch" + ) } list() {