diff options
Diffstat (limited to '.local/bin/development/gitpush')
-rwxr-xr-x | .local/bin/development/gitpush | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/.local/bin/development/gitpush b/.local/bin/development/gitpush index 97aa43b..0af8e20 100755 --- a/.local/bin/development/gitpush +++ b/.local/bin/development/gitpush @@ -1,10 +1,20 @@ #!/bin/sh -case "$(git config --get remote.origin.url)" in - *csstudent41*) sshadd ~/.ssh/github.com_id_ed25519 ;; - *labstudent41*) sshadd ~/.ssh/labstudent41_id_ed25519 ;; -esac - -git add --all -git commit # --allow-empty-message -git push -u origin +push_to_remote() { + case "$(git config --get remote.origin.url)" in + *csstudent41*) sshadd ~/.ssh/github.com_id_ed25519 ;; + *labstudent41*) sshadd ~/.ssh/labstudent41_id_ed25519 ;; + *vtc-tech*) sshadd ~/.ssh/vartaktechclub_id_ed25519 ;; + esac + + git add --all + git commit + git push -u origin +} + +[ -z "$1" ] && { push_to_remote; exit; } + +for dir in "$@"; do + cd "$dir" || exit 1 + push_to_remote +done |