Commit | Line | Data |
---|---|---|
de5b7b0b SK |
1 | #! /bin/sh |
2 | ||
3 | set -e | |
4 | ||
5 | exe="$0" | |
6 | cmd="$1" | |
7 | remote="$2" | |
8 | ||
9 | usage() { | |
10 | printf "Usage: %s [push|pull] REMOTE\n" "$exe" | |
11 | exit 1 | |
12 | } | |
13 | ||
14 | case "$cmd" in | |
15 | push | pull) ;; | |
16 | *) usage ;; | |
17 | esac | |
18 | ||
19 | case "$remote" in | |
20 | '') usage ;; | |
21 | *) ;; | |
22 | esac | |
23 | ||
24 | remote_url=$(git remote get-url "$remote") | |
25 | remote_file="${remote_url}/description" | |
26 | local_file='.git/description' | |
27 | ||
28 | case "$cmd" in | |
29 | push) scp "$local_file" "$remote_file";; | |
30 | pull) scp "$remote_file" "$local_file";; | |
31 | esac |