1 Star 0 Fork 67

Jing/my-web

forked from VTJ.PRO/my-web 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
install.js 779 Bytes
一键复制 编辑 原始数据 按行查看 历史
踩着两条虫 提交于 2020-03-21 11:36 . 更新依赖
const {spawn} = require('child_process')
const config = require('./package')
if (!config.install) {
console.log('package.json 缺少 install 配置')
return
}
const gitParams = ['clone']
if (config.install.branch) {
gitParams.push('-b', config.install.branch)
}
gitParams.push(config.install.repository, 'node_modules')
const git = config.install.type === 'git'
? spawn('git', gitParams)
: spawn('svn', ['export', config.install.repository, 'node_modules']);
git.stdout.on('data', (data) => {
console.log(`${data}`);
});
git.stderr.on('data', (data) => {
console.log(`${data}`);
});
git.on('close', (code) => {
if (code === 0) {
console.log(' install node_modules complete.\n')
} else {
console.log(' install node_modules error.\n')
}
});
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/jing-w/my-web.git
git@gitee.com:jing-w/my-web.git
jing-w
my-web
my-web
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385