Skip to content

Commit a1b4621

Browse files
committed
- Corrected issue with custom action CWD.
1 parent 9184324 commit a1b4621

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/electron.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,17 +800,19 @@ class ElectronLoader {
800800
_event,
801801
/** @type {import("./app/models/app-message").AppMessageData<"profile:runGameAction">} */ { profile, gameAction }
802802
) => {
803+
profile.gameRootDir = this.#expandPath(profile.gameRootDir);
804+
803805
// If game binary path is relative, use the `gameRootDir` as the binary dir
804806
if (!path.isAbsolute(profile.gameBinaryPath)) {
805-
profile.gameBinaryPath = path.join(profile.gameRootDir, profile.gameBinaryPath);
807+
profile.gameBinaryPath = path.join(profile.gameRootDir, this.#expandPath(profile.gameBinaryPath));
806808
}
807809

808810
// Substitute variables for profile
809811
const gameActionCmd = _.template(gameAction.actionScript)(profile);
810812

811813
// Run the action
812814
try {
813-
exec(gameActionCmd, { cwd: profile.gameBinaryPath });
815+
exec(gameActionCmd, { cwd: profile.gameRootDir });
814816
} catch(error) {
815817
throw new Error(error.toString());
816818
}

0 commit comments

Comments
 (0)