commander-scripts-ivan
Advanced tools
@@ -18,8 +18,2 @@ #!/usr/bin/env node | ||
| process.on('unhandledRejection', (err) => { | ||
| red('unhandledRejection') | ||
| console.error(err) | ||
| throw err | ||
| }) | ||
| // 创建项目指令处理 | ||
@@ -55,20 +49,12 @@ let name | ||
| try { | ||
| execSync('cnpm --version', { stdio: 'ignore' }) | ||
| execSync('yarn --version', { stdio: 'ignore' }) | ||
| return { | ||
| command: 'cnpm', | ||
| command: 'yarn', | ||
| args: ['add', '-D', '-E', STARTER], | ||
| } | ||
| } catch (err) { | ||
| return { | ||
| command: 'npm', | ||
| args: ['install', '-D', '-E', STARTER], | ||
| } | ||
| } catch (e) { | ||
| try { | ||
| execSync('yarn --version', { stdio: 'ignore' }) | ||
| return { | ||
| command: 'yarn', | ||
| args: ['add', '-D', '-E', STARTER], | ||
| } | ||
| } catch (err) { | ||
| return { | ||
| command: 'npm', | ||
| args: ['install', '-D', '-E', STARTER], | ||
| } | ||
| } | ||
| } | ||
@@ -75,0 +61,0 @@ } |
@@ -9,2 +9,9 @@ #!/usr/bin/env node | ||
| // eslint-disable-next-line prefer-arrow-callback | ||
| process.on('unhandledRejection', function getError(err) { | ||
| console.error(chalk.red('UnhandledRejection')) | ||
| console.error(err) | ||
| throw err | ||
| }) | ||
| // 检测Node.js版本前运行代码纯ES5 | ||
@@ -31,3 +38,4 @@ var packageJson = require('./package.json') // eslint-disable-line | ||
| .command('starter <project-directory> [options...]', 'starter new web project use web-scripts-ivan') | ||
| .command('copy <project-directory> [options...]', 'copy new web project from <craete react app>') | ||
| .alias('s') | ||
| .parse(process.argv) |
+1
-1
| { | ||
| "name": "commander-scripts-ivan", | ||
| "version": "0.0.16", | ||
| "version": "0.0.17", | ||
| "description": "Node.js命令行脚本", | ||
@@ -5,0 +5,0 @@ "bin": "./commander-scripts-ivan.js", |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
5102
-0.14%120
-4.76%