Skip to content

Commit

Permalink
fixed path being wrong in the releaseBuild
Browse files Browse the repository at this point in the history
  • Loading branch information
Almenon committed Aug 29, 2017
1 parent 111e255 commit bc717b6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
10 changes: 9 additions & 1 deletion src/electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,17 @@ function createWindow () {
title: 'AREPL ' + app.getVersion()
})

let indexHtmlPath = process.cwd();
if(indexHtmlPath.endsWith("arepl-win32-x64")){ //production build
indexHtmlPath = indexHtmlPath + '/resources/app/view/index.html';
}
else{
indexHtmlPath = indexHtmlPath + '/view/index.html';
}

// and load the index.html of the app.
mainWindow.loadURL(url.format({
pathname: process.cwd() + '/view/index.html',
pathname: indexHtmlPath,
protocol: 'file:',
slashes: true
}));
Expand Down
8 changes: 7 additions & 1 deletion src/evaluators.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ module.exports.PythonEvaluator = class{
*/
constructor(){
this.PythonShell = require('python-shell');
this.pythonEvalFilePath = process.cwd() + '/src/python/'

let rootPath = process.cwd();
if(rootPath.endsWith("arepl-win32-x64")){
rootPath = rootPath + '/resources/app';
}

this.pythonEvalFilePath = rootPath + '/src/python/';

// for non-windows OS it is best to use python3 instead of python
// Mac and Ubuntu both have python being v2 by default
Expand Down
7 changes: 6 additions & 1 deletion view/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@ html(lang='en')
include main
script.
// You can also require other files to run in this process
require(process.cwd() + '/src/electron/renderer.js')
let rendererPath = process.cwd();
if(rendererPath.endsWith("arepl-win32-x64")){
rendererPath = rendererPath + '/resources/app';
}
rendererPath = rendererPath + '/src/electron/renderer.js';
require(rendererPath);

0 comments on commit bc717b6

Please sign in to comment.