Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #791 from trufflesuite/feat/filecoin-clientretrieve
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeseese committed Mar 4, 2021
2 parents d449525 + 3e3ce66 commit 690cb37
Show file tree
Hide file tree
Showing 19 changed files with 2,851 additions and 2,821 deletions.
2 changes: 1 addition & 1 deletion .npmrc
@@ -1,4 +1,4 @@
engine-strict=true
engine-strict=false
save-exact=true
sign-git-commit=true
sign-git-tag=true
Expand Down
23 changes: 23 additions & 0 deletions scripts/skip-if-less-than-node-12.ts
@@ -0,0 +1,23 @@
// To use this script, run `ts-node path/to/skip-if-less-than-node-12.ts || <command>`
// This script will "succeed" if less than node@12, causing <command> to not execute
// but also make look like the overall command was successful

const majorVersionStringMatch = /^v([0-9]+)\./.exec(process.version);

if (!majorVersionStringMatch || majorVersionStringMatch.length < 2) {
console.error(
"ERROR: Could not parse process.version for some reason. This shouldn't happen."
);
process.exit(0); // we exit with code 0 to prevent further scripts from running
}

const majorVersion = parseInt(majorVersionStringMatch[1], 10);

if (majorVersion < 12) {
console.log(
`Skipping following command as the NodeJS version is ${majorVersion}, and it needs to be at least 12 to continue.`
);
process.exit(0);
} else {
process.exit(1);
}

0 comments on commit 690cb37

Please sign in to comment.