advent-of-code/2020/setup_day.sh

25 lines
452 B
Bash
Raw Normal View History

2020-12-01 07:16:56 +01:00
#!/bin/sh
today=$(date +%d)
mkdir "$today"
cd "$today"
cargo init --name "day$today"
echo 'Initialized cargo project'
2020-12-03 08:54:04 +01:00
cargo add itertools
2020-12-01 07:16:56 +01:00
# this assumes that your puzzle input is already in your clipboard
xsel -b > input
# add trailing newline if necessary
sed -i -e '$a\' input
2020-12-03 10:24:03 +01:00
echo 'fn read_input() -> String {
std::fs::read_to_string("input").unwrap()
2020-12-05 09:50:09 +01:00
}
#[cfg(test)]
mod tests {
use super::*;
use test::black_box;
2020-12-03 10:24:03 +01:00
}' >> src/main.rs