summaryrefslogtreecommitdiff
path: root/.local/bin/development/gitpush
blob: 7774a7b78f24a78a435995b037557906d3fe94f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/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
	push_to_remote
done