From 329ad06220a73c3aeb4d1c9802d8e53ae8602445 Mon Sep 17 00:00:00 2001 From: Barafu Albino Cheetah Date: Thu, 26 Sep 2024 17:23:12 +0300 Subject: [PATCH] Add `fill_template.ps1` for Powershell (#153) This is a direct 1 to 1 version of existing fill_template script, but for Powershell, to help developers using Windows. --- fill_template.ps1 | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 fill_template.ps1 diff --git a/fill_template.ps1 b/fill_template.ps1 new file mode 100644 index 0000000..13edffe --- /dev/null +++ b/fill_template.ps1 @@ -0,0 +1,13 @@ +$crate = Read-Host "To fill the template, tell me your egui project crate name: " +$name = Read-Host "To fill the template, tell me your name (for author in Cargo.toml): " +$email = Read-Host "To fill the template, tell me your e-mail address (also for Cargo.toml): " + +Write-Host "Patching files..." + +(Get-Content "Cargo.toml") -replace "eframe_template", $crate | Set-Content "Cargo.toml" +(Get-Content "src\main.rs") -replace "eframe_template", $crate | Set-Content "src\main.rs" +(Get-Content "index.html") -replace "eframe template", $crate -replace "eframe_template", $crate | Set-Content "index.html" +(Get-Content "assets\sw.js") -replace "eframe_template", $crate | Set-Content "assets\sw.js" +(Get-Content "Cargo.toml") -replace "Emil Ernerfeldt", $name -replace "emil.ernerfeldt@gmail.com", $email | Set-Content "Cargo.toml" + +Write-Host "Done." \ No newline at end of file