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() { | |
a87e65be | 10 | printf "Usage: %s (push|pull) REMOTE\n" "$exe" |
de5b7b0b SK |
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 | ||
a87e65be | 24 | file='description' |
de5b7b0b | 25 | remote_url=$(git remote get-url "$remote") |
a87e65be SK |
26 | remote_path="${remote_url}/${file}" |
27 | local_path=".git/${file}" | |
de5b7b0b SK |
28 | |
29 | case "$cmd" in | |
a87e65be SK |
30 | push) scp "$local_path" "$remote_path";; |
31 | pull) scp "$remote_path" "$local_path";; | |
de5b7b0b | 32 | esac |