Files
eulerfunt/rust/gentoml
Amneesh Singh fcce234a10 initial commit
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2022-10-26 11:51:44 +05:30

27 lines
320 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
if ! [ -e ./src/p*.rs ]; then
exit 0
fi
for problem in ./src/p*.rs; do
file=${problem##*/}
bin=${file%.*}
cat >> $toml <<EOF
[[bin]]
name = "$bin"
path = "$problem"
EOF
done