Skip to content

Commit 860387b

Browse files
Merge pull request #162 from Accedia/develop
Develop
2 parents 7c50bde + 03b6d37 commit 860387b

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

electron-app/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

electron-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "fit-mitchell-rpa",
33
"appname": "REV Import Technology",
44
"productName": "REV Import Technology",
5-
"version": "1.5.92",
5+
"version": "1.5.93",
66
"homepage": "./",
77
"main": "./dist/main.js",
88
"description": "Automation for CCC by FIT",

electron-app/src/main.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ import log from 'electron-log';
1414
import { FirebaseService, SessionStatus } from './utils/firebase';
1515
import mitchell_importer from './utils/mitchell_importer';
1616
import { spawn } from 'child_process';
17+
import * as os from 'os';
18+
19+
const userHomeDir = os.homedir();
20+
const fitMitchellCloudPath = path.join(userHomeDir, 'AppData', 'Local', 'FIT-Mitchell_Cloud', 'FIT.bat');
1721

1822
const INPUT_SPEED_STORAGE_KEY = 'inputSpeed';
1923

@@ -62,7 +66,10 @@ class Main {
6266
const url = getCustomProtocolUrl(argv);
6367
if (argv.some((url) => url.includes('openVBS'))) {
6468
try {
65-
const bat = spawn('C:\\FIT-Mitchell-Cloud-RO-Import-Tool\\FIT.bat', [], { windowsHide: true });
69+
log.info(fitMitchellCloudPath);
70+
const bat = spawn(fitMitchellCloudPath, [], { windowsHide: true });
71+
log.info('here');
72+
6673
bat.on('close', (code) => {
6774
log.info(`Child process exited with code ${code}`);
6875
app.quit();

electron-app/src/utils/window_manager.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ import { extractSessionIdFromUrl } from './extract_sessionid_from_url';
1212
import mitchell_importer from './mitchell_importer';
1313
import log from 'electron-log';
1414
import { spawn } from 'child_process';
15+
import * as os from 'os';
16+
17+
const userHomeDir = os.homedir();
18+
const fitMitchellCloudPath = path.join(userHomeDir, 'AppData', 'Local', 'FIT-Mitchell_Cloud', 'FIT.bat');
1519

1620
type MaybeBrowserWindow = BrowserWindow | null;
1721

@@ -76,7 +80,7 @@ class WindowManager {
7680
console.log('VBS URL', process.argv);
7781
if (shouldOpenVBS) {
7882
try {
79-
const bat = spawn('C:\\FIT-Mitchell-Cloud-RO-Import-Tool\\FIT.bat', [], { windowsHide: true });
83+
const bat = spawn(fitMitchellCloudPath, [], { windowsHide: true });
8084
bat.on('close', (code) => {
8185
console.log(`Child process exited with code ${code}`);
8286
app.quit();

0 commit comments

Comments
 (0)