summaryrefslogtreecommitdiff
path: root/.local/bin/development/gitpush
diff options
context:
space:
mode:
authorVikas Kushwaha <dev@vikas.rocks>2025-01-10 15:08:05 +0530
committerVikas Kushwaha <dev@vikas.rocks>2025-01-10 15:08:05 +0530
commite02304f014645a01ef6cdd40276997dea58504d9 (patch)
tree49ac70d8b348fa138f681e2fe6fa8f92b512ec9e /.local/bin/development/gitpush
parent776f17159bccd342bdc8ab9afdd035196f48d385 (diff)
Cleaning up 'bin' folder.
Diffstat (limited to '.local/bin/development/gitpush')
-rwxr-xr-x.local/bin/development/gitpush26
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