Commit 87793f94 authored by 李苏's avatar 李苏 💬

跟新脚本

parent d98091f9
const fs = require('fs')
const child_process = require('child_process');
let clone = 'CD /Users/forwards/Dev/FrontPackage && git clone git@gitlab.gavelinfo.com:lisu/common.git ';
let pull = 'CD /Users/forwards/Dev/FrontPackage && cd common && git pull';
let clone = 'D: && CD D://FrontPackage && git clone git@gitlab.gavelinfo.com:gavelinfo/frontpackage.git';
let pull = 'D: && CD D://FrontPackage && cd frontpackage && git pull ';
fs.readFile('./README.md','utf-8',(err,data)=>{
console.log(data||'Loading')
console.table(global.process.versions)
console.log('\x1B[33m%s','>正在读取项目必须依赖common包')
console.log('\x1B[33m%s','>正在读取项目依赖frontpackage包')
})
fs.mkdir('/Users/forwards/Dev/FrontPackage', (error) => {
fs.mkdir('D://FrontPackage', (error) => {
if(error){
if(error.code=='EEXIST'){
creatCommon()
......@@ -20,23 +20,23 @@ let pull = 'CD /Users/forwards/Dev/FrontPackage && cd common && git pull';
}
})
function creatCommon(){
fs.readFile('/Users/forwards/Dev/FrontPackage/common/index.js','utf-8',(err,data)=>{
fs.readFile('D:/FrontPackage/frontpackage/index.js','utf-8',(err,data)=>{
if(data){
console.log('\x1B[33m%s','>正在拉取最新commom包')
console.log('\x1B[33m%s','>正在拉取最新frontpackage包')
child_process.exec(pull,(err,s1,s2)=>{
if(err){
console.log(err)
}else{
console.log('\x1B[33m%s','>拉取common成功')
console.log('\x1B[33m%s','>拉取frontpackage成功')
}
});
}else{
console.log('\x1B[33m%s','>common读取失败,正在创建common包,请等待.....')
console.log('\x1B[33m%s','>frontpackage读取失败,正在创建frontpackage包,请等待.....')
child_process.exec(clone,(err,s1,s2)=>{
if(err){
console.log('操作报错',err,s1,s2)
}else{
console.log('\x1B[33m%s','>创建common成功')
console.log('\x1B[33m%s','>创建frontpackage成功')
}
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment