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 SK |
14 | git init >&2 |
15 | git add . >&2 | |
16 | git commit -m 'Initial commit' >&2 | |
17 | echo "$directory"; | |
18 | else | |
19 | echo "Please give the experiment a name, as the first argument."; | |
20 | exit 1; | |
21 | fi; |