Skip to content

Commit

Permalink
Fix cwd after unknown change (#501)
Browse files Browse the repository at this point in the history
* Something changed in VSCode recently
  • Loading branch information
ChristopherHX authored Jan 6, 2025
1 parent 4b87ad9 commit 0c03a43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/runner-server-vscode/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ function activate(context : ExtensionContext) {
args.push('--server', address)
}

let startproc = spawn(dotnetPath, args, { windowsHide: true, stdio: 'pipe', shell: false, env: { ...process.env } });
let startproc = spawn(dotnetPath, args, { windowsHide: true, stdio: 'pipe', shell: false, env: { ...process.env }, cwd: workspace.getWorkspaceFolder(Uri.parse(workflow))?.uri?.fsPath });
startproc.stdout.on('data', async (data) => {
var sdata = data.asciiSlice();
console.log(sdata)
Expand Down Expand Up @@ -252,7 +252,7 @@ function activate(context : ExtensionContext) {
args.push('--server', address)
}

let startproc = spawn(dotnetPath, args, { windowsHide: true, stdio: 'pipe', shell: false, env: { ...process.env } });
let startproc = spawn(dotnetPath, args, { windowsHide: true, stdio: 'pipe', shell: false, env: { ...process.env }, cwd: workspace.getWorkspaceFolder(Uri.parse(workflow))?.uri?.fsPath });
startproc.stdout.on('data', async (data) => {
var sdata = data.asciiSlice();
console.log(sdata)
Expand Down
4 changes: 2 additions & 2 deletions src/runner-server-web-vscode/client/src/browserClientMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export async function activate(context: ExtensionContext) {
var sel : string = events.length === 1 ? events : await window.showQuickPick(events, { canPickMany: false })
var args = ['--event', sel || 'push', '-W', Uri.parse(workflow).fsPath ];

let startproc = spawn('Runner.Client', args, { windowsHide: true, stdio: 'pipe', shell: false, env: { ...process.env, FORCE_COLOR: "1" } });
let startproc = spawn('Runner.Client', args, { windowsHide: true, stdio: 'pipe', shell: false, env: { ...process.env, FORCE_COLOR: "1" }, cwd: workspace.getWorkspaceFolder(Uri.parse(workflow))?.uri?.fsPath });
startproc.stdout.on('data', async (data) => {
var sdata = data.asciiSlice();
writeEmitter.fire(sdata.replace(/\r?\n/g, "\r\n"));
Expand Down Expand Up @@ -80,7 +80,7 @@ export async function activate(context: ExtensionContext) {
var sel : string = events.length === 1 ? events : await window.showQuickPick(events, { canPickMany: false })
var args = [ '--event', sel || 'push', '-W', Uri.parse(workflow).fsPath, '-j', job ];

let startproc = spawn('Runner.Client', args, { windowsHide: true, stdio: 'pipe', shell: false, env: { ...process.env, FORCE_COLOR: "1" } });
let startproc = spawn('Runner.Client', args, { windowsHide: true, stdio: 'pipe', shell: false, env: { ...process.env, FORCE_COLOR: "1" }, cwd: workspace.getWorkspaceFolder(Uri.parse(workflow))?.uri?.fsPath });
startproc.stdout.on('data', async (data) => {
var sdata = data.asciiSlice();
writeEmitter.fire(sdata.replace(/\r?\n/g, "\r\n"));
Expand Down

0 comments on commit 0c03a43

Please sign in to comment.