diff options
-rwxr-xr-x | desc | 2 | ||||
-rwxr-xr-x | help | 1 | ||||
-rwxr-xr-x | setup-remote | 29 |
3 files changed, 31 insertions, 1 deletions
@@ -19,7 +19,7 @@ case $repo in esac if [ ! -d "$repo" ]; then - echo "$repo doesn't exist" + echo "$repo does not exist" exit 1 fi @@ -12,4 +12,5 @@ unignore <name> bash clone-all-github setup-receive-hooks +setup-remote <name> <remote_name> <remote> """ diff --git a/setup-remote b/setup-remote new file mode 100755 index 0000000..f911633 --- /dev/null +++ b/setup-remote @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +if [ $# -ne 3 ]; then + echo "usage: setup-remote <name> <remote_name> <remote>" + exit 1 +fi + +set -xe + +USER="compromyse" + +base_dir="$HOME" +repo="${base_dir}/$1" + +case $repo in + *\.git) + ;; + *) + repo="${new_repo}.git" + ;; +esac + +if [ ! -d "$repo" ]; then + echo "$repo does not exist" + exit 1 +fi + +cd $repo +git remote add $2 $3 |