Skip to content

Commit

Permalink
fixup: define require() in version-check.js
Browse files Browse the repository at this point in the history
  • Loading branch information
cjihrig committed Dec 5, 2024
1 parent f9dbafb commit 8d4373a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions version-check.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
// This script is supposed to be run in travis to check package version matches
// because of this it is designed to be run on a "clean" git checkout
// because of this it is designed to be run on a "clean" git checkout
// this will fail if run after npm install (since npm install updates package-lock)
const packageVersion = require('./package.json').version
const lockVersion = require('./package-lock.json').version
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
const packageVersion = require('./package.json').version;
const lockVersion = require('./package-lock.json').version;
if (packageVersion != lockVersion) {
console.log(`version in package.json (${packageVersion}) does not match package-lock.json (${lockVersion})`);
console.log(
`version in package.json (${packageVersion}) does not match package-lock.json (${lockVersion})`,
);
process.exit(1);
}

0 comments on commit 8d4373a

Please sign in to comment.