Skip to content

Commit

Permalink
changed tempdir logic to respect TMPDIR env var
Browse files Browse the repository at this point in the history
  • Loading branch information
luv2code committed Jan 13, 2020
1 parent 658a2f8 commit a761d2a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/main-process/inklecate.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ catch(e) {
inklecatePath = path.join(inklecateRootPathDev, inklecateNames[process.platform]);
}

// TODO: Customise this for different projects
// Is this the right temporary directory even on Mac? Seems like a bad practice
// to keep files around in a "public" place that the user might wish to keep private.
const tempInkPath = (process.platform == "darwin" || process.platform == "linux") ? "/tmp/inky_compile" : path.join(process.env.temp, "inky_compile");
var tempInkPath;
if (process.platform == "darwin" || process.platform == "linux") {
tempInkPath = process.env.TMPDIR ? path.join(process.env.TMPDIR, "inky_compile") : "/tmp/inky_compile";
} else {
tempInkPath = path.join(process.env.temp, "inky_compile")
}

var sessions = {};

Expand Down

0 comments on commit a761d2a

Please sign in to comment.