Skip to content

Commit

Permalink
[mod] 修改 nushell
Browse files Browse the repository at this point in the history
  • Loading branch information
Borber committed Sep 5, 2023
1 parent e51b3df commit 1c1369a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions script/update_gui.nu
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
let lastVersion = ('../crates/gui/src-tauri/tauri.conf.json' | open | get package.version)
let Root = ( git rev-parse --show-toplevel )
let lastVersion = ($Root ++ '/crates/gui/src-tauri/tauri.conf.json' | open | get package.version)
let prompt = "Last version:" ++ $lastVersion ++ "\nNew version:"
let newVersion = (input $prompt | str trim)
let file = '../crates/gui/src/App.tsx'
let file = $Root ++ '/crates/gui/src/App.tsx'
$file | open | str replace ('<div class="version">' ++ $lastVersion ++ '</div>') ('<div class="version">' ++ $newVersion ++ '</div>') | save -f $file
let file = '../crates/gui/src-tauri/Cargo.toml';
let file = $Root ++ '/crates/gui/src-tauri/Cargo.toml';
$file | open | update package.version $newVersion | save -f $file
let file = '../crates/gui/src-tauri/tauri.conf.json'
let file = $Root ++ '/crates/gui/src-tauri/tauri.conf.json'
$file | open | update package.version $newVersion | save -f $file
let file = '../crates/gui/package.json'
let file = $Root ++ '/crates/gui/package.json'
$file | open | update version $newVersion | save -f $file

0 comments on commit 1c1369a

Please sign in to comment.