Skip to content

Commit

Permalink
Add fill_template.ps1 for Powershell (#153)
Browse files Browse the repository at this point in the history
This is a direct 1 to 1 version of existing fill_template script, but
for Powershell, to help developers using Windows.
  • Loading branch information
Barafu authored Sep 26, 2024
1 parent ac47eaf commit 329ad06
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions fill_template.ps1
Original file line number Diff line number Diff line change
@@ -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 "[email protected]", $email | Set-Content "Cargo.toml"

Write-Host "Done."

0 comments on commit 329ad06

Please sign in to comment.