Skip to content

Commit

Permalink
Add "cwd" option to shell
Browse files Browse the repository at this point in the history
  • Loading branch information
OrigamingWasTaken committed Oct 6, 2024
1 parent 3479dbb commit 8d5049b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/windows/main/ts/tools/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export interface ExecuteOptions {
completeCommand?: boolean;
/** Pass this argument to neutralino's os.execCommand function */
background?: boolean;
/** Directory from which to execute the command */
cwd?: string;
}

/**
Expand Down Expand Up @@ -64,7 +66,7 @@ export async function shell(
const fullCommand = options.completeCommand ? command : buildCommand(command, args);

const executePromise = new Promise<ExecutionResult>((resolve, reject) => {
os.execCommand(fullCommand, { background: options.background === true })
os.execCommand(fullCommand, { background: options.background === true, cwd: options.cwd })
.then((result) => {
const executionResult: ExecutionResult = {
stdOut: result.stdOut,
Expand Down

0 comments on commit 8d5049b

Please sign in to comment.