26
rust/gentoml
Executable file
26
rust/gentoml
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/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
|
Reference in New Issue
Block a user