1 Star 1 Fork 2

VTJ.PRO / MyMobileWeb

加入 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')
}
});
1
https://gitee.com/newgateway/my-mobile-web.git
git@gitee.com:newgateway/my-mobile-web.git
newgateway
my-mobile-web
MyMobileWeb
master

搜索帮助