summaryrefslogtreecommitdiff
path: root/sh/sb
blob: 08eacb452f69553c7a1e687c421a1612c0fc07f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh
# Ssh Branches

case "$1" in
	# also run commands in current Master computer
	# I use `eval "$*"` instead of just a "$@" here because passing clis to ssh sometimes requires weird quotes like `sb -m 'echo a; echo b'` and I want examples like this to work
	'-m') shift; eval "$*";;
esac

for branch in $(git -C "$HOME/programs/config_local_arch" branch | awk '!/master/{print ($1=="*")?$2:$1}'); do
	echo "sshing to server $branch..."
	ssh -t "$branch" '. "$HOME/.profile";' "$@"
done