@chenxihub/sweet-cli
Advanced tools
+0
-29
| #!/usr/bin/env node | ||
| //check node version before requiring/doing anything else | ||
| const chalk = require("chalk"); | ||
| const requiredVersion = require("../package.json").engines.node; | ||
| const semver = require("semver"); | ||
| const didYouMean = require("didyoumean"); | ||
| didYouMean.threshold = 0.6; | ||
| function checkNodeVersion(wanted, id) { | ||
| if (!semver.satisfies(process.version, wanted)) { | ||
| console.log(chalk.red( | ||
| "You are using Node " + process.version + ", but this version of " + id + | ||
| " requires Node " + wanted + ".\nPlease upgrade your Node version.", | ||
| )); | ||
| } | ||
| process.exit(1); | ||
| } | ||
| checkNodeVersion(requiredVersion, "sweet-cli"); | ||
| if (semver.satisfies(process.version, "9.x")) { | ||
| console.log(chalk.red( | ||
| `You are using Node ${process.version}.\n` + | ||
| `Node.js 9.x has already reached end-of-life and will not be supported in future major releases.\n` + | ||
| `It's strongly recommended to use an active LTS version instead.`, | ||
| )); | ||
| } | ||
| const yargs = require("yargs"); | ||
@@ -33,0 +4,0 @@ const info = require("../lib/info"); |
+3
-1
| { | ||
| "name": "@chenxihub/sweet-cli", | ||
| "version": "0.0.2", | ||
| "version": "0.0.3", | ||
| "private": false, | ||
@@ -25,2 +25,3 @@ "description": "Chen Xi Common Vue Cli Template", | ||
| "dependencies": { | ||
| "@chenxihub/sweet-cli": "^0.0.2", | ||
| "chalk": "^2.4.2", | ||
@@ -32,2 +33,3 @@ "commander": "^2.20.0", | ||
| "fs-extra": "^8.1.0", | ||
| "global": "^4.4.0", | ||
| "inquirer": "^6.4.1", | ||
@@ -34,0 +36,0 @@ "jsonfile": "^5.0.0", |
Sorry, the diff of this file is too big to display
78230
0.85%14
16.67%272
-7.8%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added