vue - check-versions.js for shell
shelljs:https://www.npmjs.com/package/shelljs , 类似linux、unix、powser shell里面的命令.
ShellJS是Node.js API之上的Unix shell命令的可移植(Windows / Linux / OS X)实现.
1 var shell = require('shelljs');
2
3 if (!shell.which('git')) {
4 shell.echo('Sorry, this script requires git');
5 shell.exit(1);
6 }
7
8
9
10 var shell = require('shelljs');
11
12 if (!shell.which('git')) {
13 shell.echo('对不起,这个脚本需要git');
14 shell.exit(1);
15 }