diff options
| author | Jake Scott <scottj@sou.edu> | 2020-11-22 11:16:09 -0800 |
|---|---|---|
| committer | Jake Scott <scottj@sou.edu> | 2020-11-22 11:16:09 -0800 |
| commit | def41d86ed5c0007681a709e0dfcf08807d58881 (patch) | |
| tree | 16884f183481ebfab0e88056c7e0ec462972f8a5 /init | |
| parent | 7302876b2a26eb4f8569e2280228831fc8f35b4b (diff) | |
added ls and init commands
Diffstat (limited to 'init')
| -rwxr-xr-x | init | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -0,0 +1,25 @@ +#!/bin/sh + +if [ $# -ne 1 ]; then + echo "usage: init <name>" + exit 1 +fi + +base_dir="$HOME" +new_repo="$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 "$base_dir/$new_repo" +git init --bare "$base_dir/$new_repo" |
