Skip to content

Commit 22dac34

Browse files
committed
fix(cli): fixed perseus new/perseus init package versions
These will automatically update now.
1 parent c3e7c35 commit 22dac34

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/perseus-cli/src/init.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ fn create_file_if_not_present(
1515
if fs::metadata(filename).is_ok() {
1616
eprintln!("[WARNING]: Didn't create '{}', since it already exists. If you didn't mean for this to happen, you should remove this file and try again.", filename_str);
1717
} else {
18-
let contents = contents.replace("%name", name);
18+
let contents = contents
19+
.replace("%name", name)
20+
.replace("%perseus_version", env!("CARGO_PKG_VERSION"));
1921
fs::write(filename, contents).map_err(|err| InitError::CreateInitFileFailed {
2022
source: err,
2123
filename: filename_str.to_string(),
@@ -115,7 +117,8 @@ pub fn new(dir: PathBuf, opts: &NewOpts, global_opts: &Opts) -> Result<i32, NewE
115117

116118
// --- BELOW ARE THE RAW FILES FOR DEFAULT INTIALIZATION ---
117119
// The token `%name` in all of these will be replaced with the given project
118-
// name NOTE: These must be updated for breaking changes
120+
// name
121+
// NOTE: These must be updated for breaking changes
119122

120123
static DFLT_INIT_CARGO_TOML: &str = r#"[package]
121124
name = "%name"
@@ -126,15 +129,15 @@ edition = "2021"
126129
127130
# Dependencies for the engine and the browser go here
128131
[dependencies]
129-
perseus = { version = "=0.4.0-beta.3", features = [ "hydrate" ] }
132+
perseus = { version = "=%perseus_version", features = [ "hydrate" ] }
130133
sycamore = "=0.8.0-beta.7"
131134
serde = { version = "1", features = [ "derive" ] }
132135
serde_json = "1"
133136
134137
# Engine-only dependencies go here
135138
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
136139
tokio = { version = "1", features = [ "macros", "rt", "rt-multi-thread" ] }
137-
perseus-warp = { version = "=0.4.0-beta.3", features = [ "dflt-server" ] }
140+
perseus-warp = { version = "=%perseus_version", features = [ "dflt-server" ] }
138141
139142
# Browser-only dependencies go here
140143
[target.'cfg(target_arch = "wasm32")'.dependencies]"#;

0 commit comments

Comments
 (0)