Commit | Line | Data |
---|---|---|
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 | file='description' | |
25 | remote_url=$(git remote get-url "$remote") | |
26 | remote_path="${remote_url}/${file}" | |
27 | local_path=".git/${file}" | |
28 | ||
29 | case "$cmd" in | |
30 | push) scp "$local_path" "$remote_path";; | |
31 | pull) scp "$remote_path" "$local_path";; | |
32 | esac |