Refactoring node engine version enforcement

This commit is contained in:
Will Boyd
2024-02-27 18:17:25 -05:00
parent 7c2be3206f
commit 5efb8b8cde
4 changed files with 1 additions and 15 deletions
-8
View File
@@ -1,6 +1,5 @@
#!/usr/bin/env node
const compareVersions = require('compare-versions');
const path = require('path');
const process = require('process');
@@ -9,13 +8,6 @@ const parser = require('./src/parser');
const writer = require('./src/writer');
(async () => {
// Node version check
const requiredVersion = '12.14.0';
const currentVersion = process.versions.node;
if (compareVersions(currentVersion, requiredVersion) === -1) {
throw `This script requires Node v${requiredVersion} or higher, but you are using v${currentVersion}.`;
}
// parse any command line arguments and run wizard
const config = await wizard.getConfig(process.argv);