Skip to content

Commit

Permalink
remove a workaround for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
shinnn committed Apr 18, 2019
1 parent f623ba0 commit aa2c073
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 35 deletions.
16 changes: 0 additions & 16 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,6 @@ const isTravisCi = process.env.TRAVIS === 'true';
const codecovBashPath = process.platform === 'win32' ? join(cwd, 'coverage', uuidV4()) : null;

(async () => {
// Remove this workaround when https://github.com/istanbuljs/v8-to-istanbul/pull/16 is merged
if (process.platform === 'win32') {
try {
const patchPath = require.resolve('./patch.txt');
const {readFile, unlink, writeFile} = require('fs');

const originalScriptPath = require.resolve('v8-to-istanbul/lib/script');
const originalScript = await promisify(readFile)(originalScriptPath, 'utf8');
await promisify(writeFile)(originalScriptPath, originalScript.replace(
/_buildLines \(source, lines, shebangLength\) \{[^9]*(?=applyCoverage)/um,
await promisify(readFile)(patchPath, 'utf8')
));
await promisify(unlink)(patchPath);
} catch {}
}

if (command === undefined) {
require(c8BinPath);
return;
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"test": "node . node . test.js"
},
"files": [
"index.js",
"patch.txt"
"index.js"
],
"bin": {
"coverage": "index.js"
Expand Down
14 changes: 0 additions & 14 deletions patch.txt

This file was deleted.

0 comments on commit aa2c073

Please # to comment.