From 658a2f840076447f50024fa4632fb923ab77befe Mon Sep 17 00:00:00 2001
From: Matthew Taylor
Date: Mon, 13 Jan 2020 11:41:25 -0600
Subject: [PATCH 1/2] removed unused vars in inklecate.js
---
.gitignore | 1 +
app/main-process/inklecate.js | 6 ++----
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/.gitignore b/.gitignore
index 626d2eb0..5445324a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,4 @@ Inky-linux-x64
Inky_windows.zip
ReleaseUpload
app/renderer/documentation/
+.idea/
diff --git a/app/main-process/inklecate.js b/app/main-process/inklecate.js
index be7f9cc7..d33a38aa 100644
--- a/app/main-process/inklecate.js
+++ b/app/main-process/inklecate.js
@@ -1,11 +1,9 @@
const child_process = require('child_process');
-const exec = child_process.exec;
const spawn = child_process.spawn;
const fs = require('fs');
const path = require("path");
const electron = require('electron');
const ipc = electron.ipcMain;
-const util = require('util');
const mkdirp = require('mkdirp');
// inklecate is packaged outside of the main asar bundle since it's executable
@@ -124,7 +122,7 @@ function compile(compileInstruction, requester) {
sessions[sessionId].ended = true;
sendAnyErrors();
-
+
if( code == 0 || code === undefined ) {
requester.send('inklecate-complete', sessionId, jsonExportPath);
}
@@ -201,7 +199,7 @@ function compile(compileInstruction, requester) {
} else {
requester.send('play-generated-text', line, sessionId);
}
-
+
}
}
From a761d2a8d61304f06cb3ee4a74784e03fd87a24f Mon Sep 17 00:00:00 2001
From: Matthew Taylor
Date: Mon, 13 Jan 2020 11:50:28 -0600
Subject: [PATCH 2/2] changed tempdir logic to respect TMPDIR env var
---
app/main-process/inklecate.js | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/app/main-process/inklecate.js b/app/main-process/inklecate.js
index d33a38aa..795f7529 100644
--- a/app/main-process/inklecate.js
+++ b/app/main-process/inklecate.js
@@ -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 = {};