mirror of
https://github.com/10h30/wordpress-export-to-markdown.git
synced 2026-07-19 22:54:11 +09:00
Refactoring node engine version enforcement
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user