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";