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