Skip to content

Commit bfcea05

Browse files
committed
Fix rust-analyzer crashing when SKIP_JS_BUILD is true
1 parent c01f4a5 commit bfcea05

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

server/build.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@ fn main() -> std::io::Result<()> {
2121
// Uncomment this line if you want faster builds during development
2222
// return Ok(());
2323

24-
// If the ATOMICSERVER_SKIP_JS_BUILD environment variable is set, skip the JS build
25-
if let Ok(env_skip) = std::env::var("ATOMICSERVER_SKIP_JS_BUILD") {
26-
if env_skip == "true" {
27-
p!("ATOMICSERVER_SKIP_JS_BUILD is set, skipping JS build.");
28-
return Ok(());
29-
}
30-
}
31-
3224
const BROWSER_ROOT: &str = "../browser/";
3325
let dirs: Dirs = {
3426
Dirs {
@@ -69,6 +61,14 @@ fn main() -> std::io::Result<()> {
6961
}
7062

7163
fn should_build(dirs: &Dirs) -> bool {
64+
// If the ATOMICSERVER_SKIP_JS_BUILD environment variable is set, skip the JS build
65+
if let Ok(env_skip) = std::env::var("ATOMICSERVER_SKIP_JS_BUILD") {
66+
if env_skip == "true" {
67+
p!("ATOMICSERVER_SKIP_JS_BUILD is set, skipping JS build.");
68+
return false;
69+
}
70+
}
71+
7272
if !dirs.browser_root.exists() {
7373
p!("Could not find browser folder, assuming this is a `cargo publish` run. Skipping JS build.");
7474
return false;

0 commit comments

Comments
 (0)