Skip to content

Commit

Permalink
feat(init): check for up-to-date nodejs version
Browse files Browse the repository at this point in the history
  • Loading branch information
thepiwo committed Feb 7, 2022
1 parent f97e992 commit 66edcf4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aeternity/aeproject",
"version": "4.0.0-alpha.2",
"version": "4.0.0-alpha.3",
"description": "aeternity smart contract testing tool",
"main": "src/lib/index.js",
"bin": {
Expand Down
9 changes: 9 additions & 0 deletions src/init/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,22 @@ const { print } = require('../utils/utils');
const { copyFolderRecursiveSync, fileExists } = require('../utils/fs-utils');

async function run(update) {
checkNodeVersion();

if (update) {
await updateAEprojectProjectLibraries();
} else {
await createAEprojectProjectStructure();
}
}

const checkNodeVersion = () => {
if (parseInt(process.version.split('.')[0].replace('v', ''), 10) < 14) {
print('You need to use Node.js 14 or newer to use aeproject.');
process.exit(1);
}
};

const createAEprojectProjectStructure = async () => {
print('===== initializing aeproject =====');

Expand Down

0 comments on commit 66edcf4

Please sign in to comment.