Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ Inky-linux-x64
Inky_windows.zip
ReleaseUpload
app/renderer/documentation/
.idea/
16 changes: 8 additions & 8 deletions app/main-process/inklecate.js
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -25,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 Expand Up @@ -124,7 +124,7 @@ function compile(compileInstruction, requester) {
sessions[sessionId].ended = true;

sendAnyErrors();

if( code == 0 || code === undefined ) {
requester.send('inklecate-complete', sessionId, jsonExportPath);
}
Expand Down Expand Up @@ -201,7 +201,7 @@ function compile(compileInstruction, requester) {
} else {
requester.send('play-generated-text', line, sessionId);
}

}

}
Expand Down