summaryrefslogtreecommitdiff
path: root/.local/bin/development/gitpush
blob: 0af8e20908a34c50a215b9ad8f0bb86140d1382c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

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