refactor: update node version check

This commit is contained in:
Isaac 2021-08-16 15:04:13 +01:00
parent 6cd6721baa
commit 96d1ddc48c
No known key found for this signature in database
GPG Key ID: 87B9B6BD04EB7534

View File

@ -24,8 +24,9 @@
process.title = 'Discord Tickets'; process.title = 'Discord Tickets';
const node_version = Number(process.versions.node.split('.')[0]); const min_node_version = '16.6.0';
if (node_version < 14) return console.log(`\x07Error: Discord Tickets does not work on Node v${node_version}. Please upgrade to v14 or above.`); const semver = require('semver');
if (semver.lt(process.versions.node, min_node_version)) return console.log(`\x07Error: Discord Tickets does not work on Node v${process.versions.node}; please upgrade to v${min_node_version} or above.`);
const leeks = require('leeks.js'); const leeks = require('leeks.js');
const fs = require('fs'); const fs = require('fs');