Skip to content

Commit

Permalink
Invert logic
Browse files Browse the repository at this point in the history
  • Loading branch information
astapleton committed Oct 15, 2024
1 parent 5924158 commit 094edc0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/verify-rust-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const cargo_toml_rust_version = cargo_toml_src.split('\n').filter(l => l.startsW

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

let exitCode = 1; // Non zero code indicates error
let exitCode = 0; // Non zero code indicates error

for (const file of files) {
const file_content = fs.readFileSync(file, 'UTF8').toString();
Expand All @@ -29,7 +29,7 @@ for (const file of files) {
for (const match of matches1) {
if (match !== cargo_toml_rust_version.substring(0, 4)) {
console.error(`Found reference to version ${match}, expected ${cargo_toml_rust_version} in file ${file}`);
exitCode = 0;
exitCode = 1;
}
}
}
Expand All @@ -38,7 +38,7 @@ for (const file of files) {
for (const match of matches2) {
if (match !== cargo_toml_rust_version) {
console.error(`Found reference to version ${match}, expected ${cargo_toml_rust_version} in ${file}`);
exitCode = 0;
exitCode = 1;
}
}
}
Expand Down

0 comments on commit 094edc0

Please sign in to comment.