Commit 25a18762 by 刘旭阳

Merge branch '0.0.3-bat-new' into 'master'

feat:优化逻辑修改bug See merge request !7
parents a04c790b 909acbf6
# babel-plugin-ry-istanbul
# babel-plugin-ry-istanbul-web
[![Coverage Status](https://coveralls.io/repos/github/istanbuljs/babel-plugin-istanbul/badge.svg?branch=master)](https://coveralls.io/github/istanbuljs/babel-plugin-istanbul?branch=master)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
......
{
"name": "babel-plugin-ry-istanbul-web",
"version": "0.0.3-bat",
"version": "0.0.5",
"author": "Thai Pangsakulyanont @dtinth",
"license": "BSD-3-Clause",
"description": "A babel plugin that adds istanbul instrumentation to ES6 code",
......
......@@ -113,15 +113,14 @@ export default declare(api => {
let BRANCH_DATA = 'origin/master'
let processData = {}
Object.keys(process.env).forEach(item => {
let isItem =
typeof process.env[item] === 'string' ? Boolean(process.env[item]) : process.env[item]
if (item.indexOf('INCREMENT')) {
let isItem = process.env[item]
if (item.indexOf('INCREMENT') !== -1) {
processData.INCREMENT = isItem
}
if (item.indexOf('IS_PITCHING_PILE')) {
if (item.indexOf('IS_PITCHING_PILE') !== -1) {
processData.IS_PITCHING_PILE = isItem
}
if (item.indexOf('PROSRC')) {
if (item.indexOf('PROSRC') !== -1) {
processData.PROSRC = process.env[item]
}
// Object.keys(processData).length
......@@ -137,7 +136,7 @@ export default declare(api => {
IS_PITCHING_PILE_DATA = instrmenttation.IS_PITCHING_PILE
}
// instrumenttation (branch: git diff 跟那个分支对比, increment 是否开启增量代码检测) 拿配置到底是全量代码还是增量代码
if (!IS_PITCHING_PILE_DATA) {
if (!IS_PITCHING_PILE_DATA || IS_PITCHING_PILE_DATA === 'false') {
return false
}
// const changeList = []
......@@ -148,10 +147,9 @@ export default declare(api => {
// return realPath.indexOf(item.to) > -1
// })
// 后面解开
if (INCREMENT_DATA && BRANCH_DATA) {
if ((INCREMENT_DATA || INCREMENT_DATA === 'true') && BRANCH_DATA) {
const gitDiffCode = execSync(`git diff ${BRANCH_DATA}`)
const diffData = parseDiffData(gitDiffCode.toString())
console.log(diffData, 'diffData')
diffScreen = diffData.find(item => {
return realPath.indexOf(item.to) > -1
})
......
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