Skip to content

Commit

Permalink
👽 Require NodeJS 10+ (execa requirement)
Browse files Browse the repository at this point in the history
  • Loading branch information
bchatard committed Aug 17, 2020
1 parent 7065302 commit 9352b8d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@

# Nodes
/node_modules

# Misc
/test.js
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

## Requirements

You need [Node.js 8.12+/9.7+](https://nodejs.org) and [Alfred 3.5+](https://www.alfredapp.com) with the paid [Powerpack](https://www.alfredapp.com/powerpack/) upgrade.
You need [Node.js 10+](https://nodejs.org) and [Alfred 3.5+](https://www.alfredapp.com) with the paid [Powerpack](https://www.alfredapp.com/powerpack/) upgrade.

This workflow need one of JetBrains products (**2019.1+**), and its [shell script](#init-shell-script) to works

Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@
"pretty-quick": "2.0.1"
},
"engines": {
"node": "^8.12.0 || >=9.7.0"
"node": ">=10"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
}
},
"volta": {
"node": "10.21.0"
}
}
8 changes: 3 additions & 5 deletions src/fileAction.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
const alfy = require("alfy");
const buildItem = require("./project").buildItem;

// check node version
const majorVersion = Number(process.version.replace("v", "").split(".")[0]);
if (majorVersion < 8) {
alfy.error(`Wrong Node version. We need v8+, you have ${process.version}`);
// check node version// check node version
if (!require("./version_checker").check()) {
return;
}

const product = require("./product").get();
const query = alfy.input;
const projectName = query.split('/').pop();
const projectName = query.split("/").pop();

const item = buildItem(product, projectName, query);

Expand Down
6 changes: 2 additions & 4 deletions src/version_checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ const minorVersion = Number(version[1]);

exports.check = () => {
if (
majorVersion < 8 || // at least v8
(majorVersion === 8 && minorVersion < 12) || // at least 8.12
(majorVersion === 9 && minorVersion < 7) // at least 9.7
majorVersion < 10 // at least v10
) {
alfy.error(
`Wrong Node version. We need v8.12+, 9.7+ or newer, you have ${process.version}`
`Wrong Node version. We need v10+ or newer, you have ${process.version}`
);
return false;
}
Expand Down

0 comments on commit 9352b8d

Please sign in to comment.