File tree Expand file tree Collapse file tree 3 files changed +3
-41
lines changed Expand file tree Collapse file tree 3 files changed +3
-41
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " serial-monitor-rust"
3- version = " 0.3.3 "
3+ version = " 0.3.2 "
44edition = " 2021"
55authors = [" Linus Leo Stöckli" ]
66description = " Serial Monitor and Plotter written in rust."
@@ -36,11 +36,9 @@ regex = "1.11"
3636name = " Serial Monitor"
3737identifier = " com.hacknus.serial_monitor"
3838icon = [" ./icons/install.png" ]
39- version = " 0.3.3"
4039copyright = " Copyright (c) hacknus 2025. All rights reserved."
4140category = " Developer Tool"
4241short_description = " Serial Monitor and Plotter written in rust."
43- license = " GPL-3.0"
4442osx_minimum_system_version = " 10.8"
4543osx_url_schemes = [" com.hacknus.serial_monitor" ]
4644
@@ -49,5 +47,4 @@ dbg-build = false
4947dbg-name = false
5048name = " Serial Monitor"
5149no-build = false
52- output = " target/wix/SerialMonitorInstaller.msi"
53- version = " 0.3.3"
50+ output = " target/wix/SerialMonitorInstaller.msi"
Original file line number Diff line number Diff line change 1- use std:: fs;
21fn main ( ) {
32 println ! ( "cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET=10.8" ) ;
4-
5- // Get the package version from the environment variable
6- let version = env ! ( "CARGO_PKG_VERSION" ) ;
7-
8- // Define the paths to `Cargo.toml`
9- let cargo_toml_path = "Cargo.toml" ;
10-
11- // Read `Cargo.toml`
12- let content = fs:: read_to_string ( cargo_toml_path) . expect ( "Failed to read Cargo.toml" ) ;
13-
14- // Replace `version = ...` only within `[package.metadata.bundle]` and `[package.metadata.wix]`
15- let updated_content = content
16- . lines ( )
17- . map ( |line| {
18- if line. trim_start ( ) . starts_with ( "version =" ) {
19- // Check if we're inside the relevant sections
20- if content. contains ( "[package.metadata.bundle]" )
21- || content. contains ( "[package.metadata.wix]" )
22- {
23- format ! ( r#"version = "{}""# , version)
24- } else {
25- line. to_string ( )
26- }
27- } else {
28- line. to_string ( )
29- }
30- } )
31- . collect :: < Vec < _ > > ( )
32- . join ( "\n " ) ;
33-
34- // Write the updated content back to `Cargo.toml`
35- fs:: write ( cargo_toml_path, updated_content) . expect ( "Failed to write updated Cargo.toml" ) ;
36-
37- println ! ( "cargo:rerun-if-changed={}" , cargo_toml_path) ;
383}
You can’t perform that action at this time.
0 commit comments