summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2025-10-11 21:05:56 -0400
committerRaghuram Subramani <raghus2247@gmail.com>2025-10-11 21:05:56 -0400
commit1c9da2f75a1c6be46c53f359c3f6c60048b933fc (patch)
tree5ffcf5e74d53edf679cca7485a7b7ba7a439ff34
parent76e32cd3267c2036b11e3b7aa68424c4ee4d5296 (diff)
add desc and customize scripts
-rw-r--r--README.md8
-rwxr-xr-xdesc24
-rwxr-xr-xhelp7
-rwxr-xr-xinit6
4 files changed, 31 insertions, 14 deletions
diff --git a/README.md b/README.md
deleted file mode 100644
index aef2c4b..0000000
--- a/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# git-shell commands
-
-Required functionality:
-
-help - usage messages
-ls - list all repositories
-init - create a new repository
-rm - remove a repository
diff --git a/desc b/desc
new file mode 100755
index 0000000..2d348ab
--- /dev/null
+++ b/desc
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+if [ $# -ne 1 ]; then
+ echo "usage: desc <name>"
+ exit 1
+fi
+
+base_dir="$HOME"
+repo="${base_dir}/$1"
+
+case $repo in
+ *\.git)
+ ;;
+ *)
+ repo="${repo}.git"
+ ;;
+esac
+
+if [ ! -d "$repo" ]; then
+ echo "$repo doesn't exist"
+ exit 1
+fi
+
+vi "${repo}/description"
diff --git a/help b/help
index cfadee6..b1333e6 100755
--- a/help
+++ b/help
@@ -3,7 +3,8 @@
echo """Welcome to git-shell on $(uname -n)!
Available Commands:
-ls: list all repositories.
-init <name>: Initialize new Git repository with <name>
-rm <name>: Delete Git repository with <name>
+ls
+init <name>
+desc <name>
+rm <name>
"""
diff --git a/init b/init
index f384f3e..2e44608 100755
--- a/init
+++ b/init
@@ -6,7 +6,7 @@ if [ $# -ne 1 ]; then
fi
base_dir="$HOME"
-new_repo="$1"
+new_repo="${base_dir}/$1"
case $new_repo in
*\.git)
@@ -21,6 +21,6 @@ if [ -d "$new_repo" ]; then
exit 1
fi
-mkdir "$base_dir/$new_repo"
-git init --bare "$base_dir/$new_repo" >/dev/null 2>&1\
+mkdir "$new_repo"
+git init --bare "$new_repo" >/dev/null 2>&1\
&& echo "Initialized empty Git repository: git@$(uname -n):$new_repo"