mirror of https://github.com/certd/certd
42 lines
980 B
JavaScript
42 lines
980 B
JavaScript
|
|
import fs from 'fs'
|
|
import childProcess from 'child_process';
|
|
function check(){
|
|
const gitAdd = fs.readFileSync("./node_modules/@lerna-lite/version/dist/lib/git-add.js","utf-8")
|
|
if(gitAdd.indexOf("('git', ['add', '.']") > -1){
|
|
console.log("git-add 已经修改过了")
|
|
}else{
|
|
console.error("git-add 没有修改过")
|
|
throw new Error("git-add 还没修改过")
|
|
}
|
|
|
|
//GH_TOKEN
|
|
console.log("检查 GH_TOKEN")
|
|
if(!process.env.GH_TOKEN){
|
|
// setx /M GH_TOKEN xxxxx
|
|
console.error("GH_TOKEN 未设置")
|
|
throw new Error("GH_TOKEN 未设置")
|
|
}
|
|
}
|
|
|
|
function checkDist(){
|
|
|
|
function scanDir(root,excludes){
|
|
//扫描文件,忽略node_modules
|
|
const files = fs.readdirSync(root)
|
|
const dirs = []
|
|
for (const file of files) {
|
|
if (excludes.includes(file)) {
|
|
continue;
|
|
}
|
|
const filePath = join(root, file);
|
|
}
|
|
|
|
console.log("检查",file)
|
|
}
|
|
|
|
|
|
}
|
|
checkDist()
|
|
// check()
|