Skip to content

Commit 1b4de69

Browse files
authored
Merge pull request #332 from sc-forks/maint/yarn
Use yarn
2 parents 81e59cb + dab3634 commit 1b4de69

File tree

5 files changed

+5314
-5687
lines changed

5 files changed

+5314
-5687
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
- run:
1313
name: Install dependencies
1414
command: |
15-
npm install
15+
yarn
1616
- run:
17-
name: Get submodules
17+
name: Get submodules
1818
command: |
1919
git submodule update --init
2020
- run:

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,12 @@ Contributions are welcome! If you're opening a PR that adds features please cons
140140
also lint your submission with `npm run lint`. Bugs can be reported in the
141141
[issues](https://github.com/sc-forks/solidity-coverage/issues).
142142

143+
Set up the development environment with:
144+
```
145+
$ git clone https://github.com/sc-forks/solidity-coverage.git
146+
$ yarn
147+
```
148+
143149
### Contributors
144150
+ [@area](https://github.com/area)
145151
+ [@cgewecke](https://github.com/cgewecke)

lib/app.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,13 @@ class App {
9494
});
9595
}
9696

97-
// Load config if present, accomodate common windows naming.
97+
// Load config
9898
let truffleConfig;
99+
let oldTrufflePath = `${this.workingDir}/truffle.js`;
100+
let newTrufflePath = `${this.workingDir}/truffle-config.js`;
99101

100-
shell.test('-e', `${this.workingDir}/truffle.js`)
101-
? truffleConfig = reqCwd.silent(`${this.workingDir}/truffle.js`)
102-
: truffleConfig = reqCwd.silent(`${this.workingDir}/truffle-config.js`);
102+
if (shell.test('-e', oldTrufflePath)) truffleConfig = reqCwd.silent(oldTrufflePath);
103+
else if (shell.test('-e', newTrufflePath)) truffleConfig = reqCwd.silent(newTrufflePath);
103104

104105
// Coverage network opts specified: use port if declared
105106
if (truffleConfig && truffleConfig.networks && truffleConfig.networks.coverage) {
@@ -109,10 +110,7 @@ class App {
109110
// No coverage network defaults to the dev network on port 8555, high gas / low price.
110111
} else {
111112
const trufflejs = defaultTruffleConfig(this.port, gasLimitHex, gasPriceHex);
112-
113-
(process.platform === 'win32')
114-
? fs.writeFileSync(`${this.coverageDir}/truffle-config.js`, trufflejs)
115-
: fs.writeFileSync(`${this.coverageDir}/truffle.js`, trufflejs);
113+
fs.writeFileSync(`${this.coverageDir}/truffle-config.js`, trufflejs);
116114
}
117115

118116
// Compile the contracts before instrumentation and preserve their ABI's.
@@ -272,7 +270,7 @@ class App {
272270
const defaultCommand = `truffle compile ${this.network} ${this.silence}`;
273271
const command = this.compileCommand || defaultCommand;
274272
this.log(`Running: ${command}\n(this can take a few seconds)...`);
275-
273+
276274
shell.cd(this.coverageDir);
277275
shell.exec(command);
278276
this.testsErrored = shell.error();

0 commit comments

Comments
 (0)