X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=home%2Fbin%2Fx;h=1b04be62685a44a0f1925c2a35992bfea2d590b9;hb=3690e80787227651b5d47add3c823014318bb365;hp=eb5aee2d4950dd89925da05e70b1cad35cfd3910;hpb=cdfb443f36e824c606cf2c194d645735d53065f3;p=khome.git diff --git a/home/bin/x b/home/bin/x index eb5aee2..1b04be6 100755 --- a/home/bin/x +++ b/home/bin/x @@ -3,20 +3,13 @@ set -e; name=$(echo "$@" | sed 's/\s\+/-/g'); - -if [ "$name" != "" ]; -then - timestamp=$(date +'%F--%H-%M-%S'); - directory="$HOME/x/$timestamp--$name"; - mkdir -p "$directory"; - cd "$directory"; - printf '# %s\n' "$name" > README; - git init >&2 - git commit --allow-empty -m 'Root commit' >&2 - git add . >&2 - git commit -m 'Initial commit' >&2 - echo "$directory"; -else - echo "Please give the experiment a name, as the first argument."; - exit 1; -fi; +timestamp=$(date +'%F--%H-%M-%S'); +directory="$HOME/x/$timestamp--$name"; +mkdir -p "$directory"; +cd "$directory"; +printf '# %s\n' "$name" > README; +git init >&2 +git commit --allow-empty -m 'Root commit' >&2 +git add . >&2 +git commit -m 'Initial commit' >&2 +echo "$directory";