Commit | Line | Data |
---|---|---|
64ec9f23 SK |
1 | #! /bin/sh |
2 | ||
3 | set -e; | |
4 | ||
0443168a | 5 | name=$(echo "$@" | sed 's/\s\+/-/g'); |
64ec9f23 SK |
6 | |
7 | if [ "$name" != "" ]; | |
8 | then | |
807bbf47 | 9 | timestamp=$(date +'%F--%H-%M-%S'); |
a42aa7f8 | 10 | directory="$HOME/x/$timestamp--$name"; |
64ec9f23 SK |
11 | mkdir -p "$directory"; |
12 | cd "$directory"; | |
0443168a | 13 | printf '# %s\n' "$name" > README; |
64ec9f23 | 14 | git init >&2 |
dcc0170d | 15 | git commit --allow-empty -m 'Root commit' >&2 |
64ec9f23 SK |
16 | git add . >&2 |
17 | git commit -m 'Initial commit' >&2 | |
18 | echo "$directory"; | |
19 | else | |
20 | echo "Please give the experiment a name, as the first argument."; | |
21 | exit 1; | |
22 | fi; |