advent-of-code/2020/setup_day.sh
2020-12-05 09:50:09 +01:00

25 lines
452 B
Bash
Executable File

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