Skip to content

Commit 38ae87c

Browse files
authored
Fix cargo-watch (#1123)
1 parent d791338 commit 38ae87c

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

pgml-dashboard/.ignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*package-lock.json
2+
node_modules/

pgml-dashboard/build.rs

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,21 @@ fn main() {
1111
let git_hash = String::from_utf8(output.stdout).unwrap();
1212
println!("cargo:rustc-env=GIT_SHA={}", git_hash);
1313

14-
let status = Command::new("cargo")
15-
.arg("pgml-components")
16-
.arg("bundle")
17-
.arg("--lock")
18-
.status()
19-
.expect("failed to run 'cargo pgml-bundle'");
20-
21-
if !status.success() {
22-
panic!("failed to run 'cargo pgml-bundle'");
14+
for i in 0..5 {
15+
let status = Command::new("cargo")
16+
.arg("pgml-components")
17+
.arg("bundle")
18+
.arg("--lock")
19+
.status()
20+
.expect("failed to run 'cargo pgml-bundle'");
21+
22+
if !status.success() {
23+
if i < 4 {
24+
println!("cargo:warning=failed to run 'cargo pgml-bundle', retrying");
25+
} else {
26+
panic!("failed to run 'cargo pgml-bundle'");
27+
}
28+
}
2329
}
2430

2531
let css_version =

0 commit comments

Comments
 (0)