Skip to content

Commit

Permalink
Merge branch 'hotfix/cloud_pc_v1.7.5' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
extracold1209 committed Jul 31, 2019
2 parents bcda5be + 1fab5cb commit f54fb5d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions app/src/main/flasher.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { dialog } = require('electron');
const { app, dialog } = require('electron');
const exec = require('child_process').exec;
const path = require('path');
const fs = require('fs');
Expand All @@ -13,15 +13,15 @@ const platform = process.platform;
*/
class Flasher {
static get firmwareDirectoryPath() {
const asarIndex = __dirname.indexOf('app.asar');
const asarIndex = app.getAppPath().indexOf(`${path.sep}app.asar`);
if (asarIndex > -1) {
const asarPath = __dirname.substr(0, asarIndex);
const externalFlahserPath = path.join(asarPath, 'firmwares');
const flasherPath = path.resolve(__dirname, '..', '..', 'firmwares');
if (!fs.existsSync(externalFlahserPath)) {
Utils.copyRecursiveSync(flasherPath, externalFlahserPath);
const asarPath = app.getAppPath().substr(0, asarIndex);
const externalFlasherPath = path.join(asarPath, 'firmwares');
const flasherPath = path.resolve(app.getAppPath(), __dirname, '..', '..', 'firmwares');
if (!fs.existsSync(externalFlasherPath)) {
Utils.copyRecursiveSync(flasherPath, externalFlasherPath);
}
return externalFlahserPath;
return externalFlasherPath;
} else {
return path.resolve('app', 'firmwares');
}
Expand Down

0 comments on commit f54fb5d

Please sign in to comment.