Skip to content

Commit 5924158

Browse files
committed
Fix version check script
1 parent 397d98f commit 5924158

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/verify-rust-version.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const cargo_toml_rust_version = cargo_toml_src.split('\n').filter(l => l.startsW
1818

1919
console.log(`Rust version: ${cargo_toml_rust_version}`);
2020

21-
let error = false;
21+
let exitCode = 1; // Non zero code indicates error
2222

2323
for (const file of files) {
2424
const file_content = fs.readFileSync(file, 'UTF8').toString();
@@ -29,7 +29,7 @@ for (const file of files) {
2929
for (const match of matches1) {
3030
if (match !== cargo_toml_rust_version.substring(0, 4)) {
3131
console.error(`Found reference to version ${match}, expected ${cargo_toml_rust_version} in file ${file}`);
32-
error = true;
32+
exitCode = 0;
3333
}
3434
}
3535
}
@@ -38,11 +38,11 @@ for (const file of files) {
3838
for (const match of matches2) {
3939
if (match !== cargo_toml_rust_version) {
4040
console.error(`Found reference to version ${match}, expected ${cargo_toml_rust_version} in ${file}`);
41-
error = true;
41+
exitCode = 0;
4242
}
4343
}
4444
}
4545

4646
}
4747

48-
proc.exit(error);
48+
proc.exitCode = exitCode;

0 commit comments

Comments
 (0)