Skip to content

Commit

Permalink
Update Python automation script
Browse files Browse the repository at this point in the history
  • Loading branch information
temeddix committed Jun 9, 2024
1 parent d4f0a6a commit 4dcaf20
Showing 1 changed file with 36 additions and 16 deletions.
52 changes: 36 additions & 16 deletions automate/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,33 @@ def replace_text_in_file(filepath: str, change_from: str, change_to: str):
# Enable the web target, since it's not enabled by default.
replace_text_in_file(
"native/hub/src/lib.rs",
"use tokio;",
"// use tokio;",
'// #[cfg(not(target_family = "wasm"))]',
'#[cfg(not(target_family = "wasm"))]',
)
replace_text_in_file(
"native/hub/src/lib.rs",
"// use tokio_with_wasm",
"use tokio_with_wasm",
'// #[cfg(target_family = "wasm")]',
'#[cfg(target_family = "wasm")]',
)
replace_text_in_file(
"native/hub/src/lib.rs",
"// use tokio_with_wasm as tokio;",
"use tokio_with_wasm as tokio;",
)
replace_text_in_file(
"native/hub/Cargo.toml",
"# [target.'cfg(target_family = \"wasm\")'.dependencies]",
"[target.'cfg(target_family = \"wasm\")'.dependencies]",
)
replace_text_in_file(
"native/hub/Cargo.toml",
"# wasm-bindgen",
"wasm-bindgen",
'# wasm-bindgen = "0.2.92"',
'wasm-bindgen = "0.2.92"',
)
replace_text_in_file(
"native/hub/Cargo.toml",
"# tokio_with_wasm",
"tokio_with_wasm",
'# tokio_with_wasm = { version = "0.5.1", features = ["sync"] }',
'tokio_with_wasm = { version = "0.5.1", features = ["sync"] }',
)

os.chdir("../")
Expand Down Expand Up @@ -104,23 +114,33 @@ def replace_text_in_file(filepath: str, change_from: str, change_to: str):
# Enable the web target, since it's not enabled by default.
replace_text_in_file(
"native/hub/src/lib.rs",
"use tokio;",
"// use tokio;",
'// #[cfg(not(target_family = "wasm"))]',
'#[cfg(not(target_family = "wasm"))]',
)
replace_text_in_file(
"native/hub/src/lib.rs",
"// use tokio_with_wasm",
"use tokio_with_wasm",
'// #[cfg(target_family = "wasm")]',
'#[cfg(target_family = "wasm")]',
)
replace_text_in_file(
"native/hub/src/lib.rs",
"// use tokio_with_wasm as tokio;",
"use tokio_with_wasm as tokio;",
)
replace_text_in_file(
"native/hub/Cargo.toml",
"# [target.'cfg(target_family = \"wasm\")'.dependencies]",
"[target.'cfg(target_family = \"wasm\")'.dependencies]",
)
replace_text_in_file(
"native/hub/Cargo.toml",
"# wasm-bindgen",
"wasm-bindgen",
'# wasm-bindgen = "0.2.92"',
'wasm-bindgen = "0.2.92"',
)
replace_text_in_file(
"native/hub/Cargo.toml",
"# tokio_with_wasm",
"tokio_with_wasm",
'# tokio_with_wasm = { version = "0.5.1", features = ["sync"] }',
'tokio_with_wasm = { version = "0.5.1", features = ["sync"] }',
)

os.chdir("../")
Expand Down

0 comments on commit 4dcaf20

Please sign in to comment.