diff options
author | Raghuram Subramani <raghus2247@gmail.com> | 2025-10-15 18:36:44 -0400 |
---|---|---|
committer | Raghuram Subramani <raghus2247@gmail.com> | 2025-10-15 18:36:44 -0400 |
commit | 428761f1db5fbdc171a60188bce7eda03d4f63bf (patch) | |
tree | af6c25ea09417df9b8de0133561bd9a7828a2a1b | |
parent | a78560944934d7728ae8d2949a5201487c0e4867 (diff) |
add setup-remote
-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 |