Skip to content
Snippets Groups Projects
Unverified Commit be52779b authored by Aya Morisawa's avatar Aya Morisawa Committed by GitHub
Browse files

Use descriptive variables to improve readability (#3318)

parent 23b64794
No related branches found
No related tags found
No related merge requests found
......@@ -103,6 +103,10 @@ async function workerMain() {
}
}
const runningNodejsVersion = process.version.slice(1).split('.').map(x => parseInt(x, 10));
const requiredNodejsVersion = [10, 0, 0];
const satisfyNodejsVersion = !lessThan(runningNodejsVersion, requiredNodejsVersion);
/**
* Init app
*/
......@@ -110,9 +114,10 @@ async function init(): Promise<Config> {
Logger.info('Welcome to Misskey!');
Logger.info(`<<< Misskey v${pkg.version} >>>`);
new Logger('Nodejs').info(`Version ${process.version}`);
if (lessThan(process.version.slice(1).split('.').map(x => parseInt(x, 10)), [10, 0, 0])) {
new Logger('Nodejs').error(`Node.js version is less than 10.0.0. Please upgrade it.`);
new Logger('Nodejs').info(`Version ${runningNodejsVersion.join('.')}`);
if (!satisfyNodejsVersion) {
new Logger('Nodejs').error(`Node.js version is less than ${requiredNodejsVersion.join('.')}. Please upgrade it.`);
process.exit(1);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment