Bug fix for windows file paths

pull/116/head
Dan Phifer 7 years ago
parent dfd6742c69
commit 8a86dc777a
  1. 6
      lib/app.js

@ -8,6 +8,8 @@ const getInstrumentedVersion = require('./instrumentSolidity.js');
const CoverageMap = require('./coverageMap.js');
const defaultTruffleConfig = require('./truffleConfig.js');
const isWin = /^win/.test(process.platform);
const gasLimitHex = 0xfffffffffff; // High gas block limit / contract deployment limit
const gasPriceHex = 0x01; // Low gas price
@ -111,7 +113,9 @@ class App {
this.log('Instrumenting ', file);
currentFile = file;
const contractPath = path.resolve(file);
const contractPath = isWin
? path.resolve(file).split('\\').join('/')
: path.resolve(file);
const working = this.workingDir.substring(1);
const canonicalPath = contractPath.split('/coverageEnv').join(working);
const contract = fs.readFileSync(contractPath).toString();

Loading…
Cancel
Save