Skip to content

Commit

Permalink
Use os.tmpdir() instead of hardcoding /tmp/
Browse files Browse the repository at this point in the history
/tmp/ does not exist on Windows
  • Loading branch information
ccampbell committed Jun 15, 2018
1 parent c4ae8cd commit d837f23
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/luna.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import chalk from 'chalk';
import { PREFIX } from './util';
const fs = require('fs');
const yargs = require('yargs');
const os = require('os');
const path = require('path');
const version = require('./../package.json').version;
const ci = require('ci-info');

Expand Down Expand Up @@ -92,7 +94,7 @@ if (ci.isCI) {
let fileName;
const hasCoverage = options.coverage;
if (hasCoverage) {
fileName = `/tmp/coverage-${process.pid}.json`;
fileName = path.join(os.tmpdir(), `coverage-${process.pid}.json`);
console.log(PREFIX.coverage, fileName);
}

Expand Down

0 comments on commit d837f23

Please sign in to comment.