From dccf65fb2df7a438607b99821db956c6bc74d11c Mon Sep 17 00:00:00 2001 From: "GREGORY-PC\\Gregory" Date: Fri, 15 Mar 2019 16:16:08 +0100 Subject: [PATCH] tmp file creation moved from /tmp/src/... to /home/tmp directory. AppImages can't write on file that are not in the home folder. --- src/renderer.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/renderer.js b/src/renderer.js index 3b8a30b..d002da6 100644 --- a/src/renderer.js +++ b/src/renderer.js @@ -26,11 +26,13 @@ var electronShell = require("electron").shell; var dataPath = currentWindow.dataPath.replace(/ /g,"\\ "); var desktopPath = currentWindow.desktopPath; var appPath = currentWindow.appPath; +var homePath = electron.remote.app.getPath('home'); console.info("dataPath",dataPath); console.info("desktopPath",desktopPath); console.info("appPath",appPath); +console.info("homePath",homePath); var selectFileBtnEl = document.getElementById('selectFileBtn'); @@ -150,13 +152,19 @@ createSubtitlesEl.onclick = function(){ // var subtitlesComposer = require('../node_modules/subtitlescomposer'); var tmpOutputFilePath = path.join(desktopPath, tmpOutputFileName); + fs.mkdir(homePath+"/tmp",function(err){ + if (!err) { + console.log("tmp directory created successfully!"); + } + }); + subtitlescomposer({ punctuationTextContent: getContentFromTextEditor(), // the number of character per srt subtitle file line. // TODO: add param to specify with default numberOfCharPerLine: getCharPerLineInput(), // where to save intermediate segmented text file needed for aeneas module - segmentedTextInput: appPath+"/src/tmp/segmentedtext.tmp.txt", + segmentedTextInput: homePath+"/tmp/segmentedtext.tmp.txt", //audio or video file to use for aeneas alignement as original source mediaFile: sourceVideoPath, outputCaptionFile: tmpOutputFilePath,