Files
eulerfunt/rust/gentoml
Amneesh Singh 4e98bf2115 rust: add p1, p2
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2022-10-27 04:16:43 +05:30

25 lines
312 B
Bash
Executable File

#!/usr/bin/env sh
toml=Cargo.toml
name=eulerfunt
cat > $toml <<EOF
[package]
name = "$name"
version = "0.1.0"
edition = "2021"
EOF
[[ ! $(ls ./src/p*.rs) ]] && exit 0
for problem in ./src/p*.rs; do
file=${problem##*/}
bin=${file%.*}
cat >> $toml <<EOF
[[bin]]
name = "$bin"
path = "$problem"
EOF
done