Skip to content

Commit cfc86b9

Browse files
author
Marc Rooding
committed
Merge branch 'master' of github.com:mrooding/gulp-protractor-cucumber-html-report
2 parents 3f7ca72 + e07e287 commit cfc86b9

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,16 @@ module.exports = function JsonOutputHook() {
6060
var path = require('path');
6161

6262
JsonFormatter.log = function (json) {
63-
fs.writeFile(path.join(__dirname, './reports/cucumber-test-results.json'), json, function (err) {
64-
if (err) throw err;
65-
console.log('json file location: ' + path.join(__dirname, './reports/cucumber-test-results.json'));
63+
var destination = path.join(__dirname, '../../reports/cucumber-test-results.json');
64+
fs.open(destination, 'w+', function (err, fd) {
65+
if (err) {
66+
fs.mkdirsSync(destination);
67+
fd = fs.openSync(destination, 'w+');
68+
}
69+
70+
fs.writeSync(fd, json);
71+
72+
console.log('json file location: ' + destination);
6673
});
6774
};
6875

@@ -127,4 +134,4 @@ Copyright for portions of project [gulp-protractor-cucumber-html-report](https:/
127134

128135
0.0.5:
129136
- More robust creation of the output directory [thanks smuldr!](https://github.com/smuldr)
130-
- Fixed the HTML reporter when using multiple feature files
137+
- Fixed the HTML reporter when using multiple feature files

0 commit comments

Comments
 (0)