blob: 38825b174dc800e04230558324a02546f7c9c2ea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#!/bin/sh -e
YEAR=${YEAR:-$(date +%Y)}
DAY=${DAY:-$(TZ=EST date '+%d')}
GIT_USER=$(git config --get 'user.name')
GIT_EMAIL=$(git config --get 'user.email')
CARGO=$( sed "s/^#\( *${DAY}\)/\1/" <"${YEAR}/rust/Cargo.toml")
echo "${CARGO}" >"${YEAR}/rust/Cargo.toml"
cd "${YEAR}/rust"
mkdir "day${DAY}" || :
cd "day${DAY}"
cargo init --bin
cat > 'Cargo.toml' << END_OF_TOML
[package]
name = "day${DAY}"
version = "0.1.0"
authors = ["${GIT_USER} <${GIT_EMAIL}>"]
edition = "2018"
[dependencies]
END_OF_TOML
|