diff --git a/workflows/energy_plus/module/module.js b/workflows/energy_plus/module/module.js index 2cc4479..ec8ccf3 100644 --- a/workflows/energy_plus/module/module.js +++ b/workflows/energy_plus/module/module.js @@ -1,4 +1,4 @@ -const BrowserWindow = require('electron') +const { BrowserWindow, app } = require('electron') const fs = require('fs') const path = require('path') const { Blob } = require('buffer') @@ -8,8 +8,7 @@ const energy_plus = 'https://nextgenerations-cities.encs.concordia.ca/api/v1.4/w exports.run = async (application, param, tmp_path) => { console.log(`Executing ${application}`) - env_path = path.resolve(`${__dirname}/../../../environments/workflow_launcher/.env`) - dotenv.config({ path: env_path }) + dotenv.config({ path: path.resolve(`${app.getAppPath()}/environments/workflow_launcher/.env`) }) const application_uuid = process.env.APPLICATION const username = process.env.APPLICATION_USERNAME const password = process.env.APPLICATION_PASSWORD diff --git a/workflows/idf/main.html b/workflows/idf/main.html index b1d53d2..261017c 100644 --- a/workflows/idf/main.html +++ b/workflows/idf/main.html @@ -19,7 +19,7 @@
diff --git a/workflows/idf/module/module.js b/workflows/idf/module/module.js index 9b1a22e..f02bde6 100644 --- a/workflows/idf/module/module.js +++ b/workflows/idf/module/module.js @@ -1,4 +1,4 @@ -const BrowserWindow = require('electron') +const { BrowserWindow, app } = require('electron') const path = require('path') const dotenv = require('dotenv') const session_start = 'https://nextgenerations-cities.encs.concordia.ca/api/v1.4/session/start' @@ -7,8 +7,7 @@ const retrofit_results = 'https://nextgenerations-cities.encs.concordia.ca/api/v exports.run = async (application, param, tmp_path) => { buildings = param['buildings'] console.log(`Executing idf generation for ${application}`) - env_path = path.resolve(`${__dirname}/../../../environments/${application}/.env`) - dotenv.config({ path: env_path }) + dotenv.config({ path: path.resolve(`${app.getAppPath()}/environments/${application}/.env`) }) const application_uuid = process.env.APPLICATION const username = process.env.APPLICATION_USERNAME const password = process.env.APPLICATION_PASSWORD diff --git a/workflows/meb/module/module.js b/workflows/meb/module/module.js index 91d6e59..189d7f6 100644 --- a/workflows/meb/module/module.js +++ b/workflows/meb/module/module.js @@ -1,4 +1,4 @@ -const BrowserWindow = require('electron') +const { BrowserWindow, app } = require('electron') const fs = require('fs') const path = require('path') const { Blob } = require('buffer') @@ -9,8 +9,7 @@ const insel_meb = 'https://nextgenerations-cities.encs.concordia.ca/api/v1.4/wor exports.run = async (application, param, tmp_path) => { console.log(`Executing ${application}`) - env_path = path.resolve(`${__dirname}/../../../environments/workflow_launcher/.env`) - dotenv.config({ path: env_path }) + dotenv.config({ path: path.resolve(`${app.getAppPath()}/environments/workflow_launcher/.env`) }) const application_uuid = process.env.APPLICATION const username = process.env.APPLICATION_USERNAME const password = process.env.APPLICATION_PASSWORD diff --git a/workflows/retrofit/module/module.js b/workflows/retrofit/module/module.js index 3f0df55..d74130e 100644 --- a/workflows/retrofit/module/module.js +++ b/workflows/retrofit/module/module.js @@ -1,4 +1,4 @@ -const { BrowserWindow } = require('electron') +const { BrowserWindow, app } = require('electron') const path = require('path') const dotenv = require('dotenv') const session_start = 'https://nextgenerations-cities.encs.concordia.ca/api/v1.4/session/start' @@ -6,9 +6,8 @@ const retrofit_results = 'https://nextgenerations-cities.encs.concordia.ca/api/v exports.run = async (application, param, tmp_path) => { buildings = param['buildings'] - console.log(`Executing ${application}`) - env_path = path.resolve(`${__dirname}/../../../environments/${application}/.env`) - dotenv.config({ path: env_path }) + console.log(`Executing ${application} `) + dotenv.config({ path: path.resolve(`${app.getAppPath()}/environments/${application}/.env`) }) const application_uuid = process.env.APPLICATION const username = process.env.APPLICATION_USERNAME const password = process.env.APPLICATION_PASSWORD