From e02304f014645a01ef6cdd40276997dea58504d9 Mon Sep 17 00:00:00 2001 From: Vikas Kushwaha Date: Fri, 10 Jan 2025 15:08:05 +0530 Subject: Cleaning up 'bin' folder. --- .local/bin/development/gitpush | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to '.local/bin/development/gitpush') 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 -- cgit v1.2.3