summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2025-10-11 21:16:06 -0400
committerRaghuram Subramani <raghus2247@gmail.com>2025-10-11 21:16:06 -0400
commit6944c7f7c2a2be62526856a641fab5672a0c5c48 (patch)
treea41c5ae09674d25ded798dce81499cd250166564
parent1c9da2f75a1c6be46c53f359c3f6c60048b933fc (diff)
add clone
-rwxr-xr-xclone28
-rwxr-xr-xinit2
2 files changed, 29 insertions, 1 deletions
diff --git a/clone b/clone
new file mode 100755
index 0000000..f2bf406
--- /dev/null
+++ b/clone
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+if [ $# -ne 1 ]; then
+ echo "usage: clone <name>"
+ exit 1
+fi
+
+USER="compromyse"
+
+base_dir="$HOME"
+new_repo="${base_dir}/$1"
+
+case $new_repo in
+ *\.git)
+ ;;
+ *)
+ new_repo="${new_repo}.git"
+ ;;
+esac
+
+if [ -d "$new_repo" ]; then
+ echo "$new_repo already exists"
+ exit 1
+fi
+
+mkdir "$new_repo"
+git clone --bare "git@github.com:$USER/$1" "$new_repo" \
+ && echo "Cloned Git repository to: git@$(uname -n):$1"
diff --git a/init b/init
index 2e44608..08e7897 100755
--- a/init
+++ b/init
@@ -23,4 +23,4 @@ fi
mkdir "$new_repo"
git init --bare "$new_repo" >/dev/null 2>&1\
- && echo "Initialized empty Git repository: git@$(uname -n):$new_repo"
+ && echo "Initialized empty Git repository: git@$(uname -n):$1"