Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions fill_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,34 @@
set -e

echo "To fill the template tell me your egui project crate name: "

read crate

echo "To fill the template tell me your name (for author in Cargo.toml): "

read name

echo "To fill the template tell me your e-mail address (also for Cargo.toml): "

read email

echo "Patching files..."

sed -i "s/eframe_template/$crate/g" Cargo.toml
sed -i "s/eframe_template/$crate/g" src/main.rs
sed -i "s/eframe template/$crate/g" index.html
sed -i "s/eframe_template/$crate/g" assets/sw.js
sed -i "s/Emil Ernerfeldt/$name/g" Cargo.toml
sed -i "s/emil.ernerfeldt@gmail.com/$email/g" Cargo.toml
# Determine the correct sed syntax based on OS
if [ "$(uname)" = "Darwin" ]; then
# macOS sed
sed_inplace() {
sed -i '' "$@"
}
else
# GNU sed (Linux)
sed_inplace() {
sed -i "$@"
}
fi

sed_inplace "s/eframe_template/$crate/g" Cargo.toml
sed_inplace "s/eframe_template/$crate/g" src/main.rs
sed_inplace "s/eframe template/$crate/g" index.html
sed_inplace "s/eframe_template/$crate/g" assets/sw.js
sed_inplace "s/Emil Ernerfeldt/$name/g" Cargo.toml
sed_inplace "s/emil.ernerfeldt@gmail.com/$email/g" Cargo.toml

echo "Done."

Loading