Skip to content

Commit

Permalink
fix windows runner not starting (#420)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherHX authored Oct 26, 2024
1 parent 8f7408e commit 8d35dae
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/runner-server-vscode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function activate(context) {
var i = sdata.indexOf("http://");
if(i !== -1) {
var end = sdata.indexOf('\n', i + 1);
address = sdata.substring(i, end).replace("[::]", "localhost").replace("0.0.0.0", "localhost");
address = sdata.substring(i, end).replace("[::]", "localhost").replace("0.0.0.0", "localhost").trim();

var panel = vscode.window.createWebviewPanel(
"runner.server",
Expand All @@ -75,9 +75,8 @@ function activate(context) {
if(address) {
args.push('--server', address)
}
setTimeout(() => {
vscode.window.createTerminal("runner.client", dotnetPath, args)
}, 2000);
context.subscriptions.push(vscode.window.createTerminal("runner.client", dotnetPath, args));

const cspSource = panel.webview.cspSource;
// Get the content Uri
const style = panel.webview.asWebviewUri(
Expand Down Expand Up @@ -106,7 +105,7 @@ function activate(context) {
if(address) {
args.push('--server', address)
}
vscode.window.createTerminal("runner.client", dotnetPath, args)
context.subscriptions.push(vscode.window.createTerminal("runner.client", dotnetPath, args))
});

vscode.commands.registerCommand("runner.server.runworkflow", (workflow) => {
Expand All @@ -115,15 +114,15 @@ function activate(context) {
if(address) {
args.push('--server', address)
}
vscode.window.createTerminal("runner.client", dotnetPath, args)
context.subscriptions.push(vscode.window.createTerminal("runner.client", dotnetPath, args))
});
vscode.commands.registerCommand("runner.server.runjob", (workflow, job) => {
console.log(`runner.server.runjob {workflow}.{job}`)
var args = [ path.join(context.extensionPath, 'native', 'Runner.Client.dll'), '-W', vscode.Uri.parse(workflow).fsPath, '-j', job ];
if(address) {
args.push('--server', address)
}
vscode.window.createTerminal("runner.client", dotnetPath, args)
context.subscriptions.push(vscode.window.createTerminal("runner.client", dotnetPath, args))
});

context.subscriptions.push(client);
Expand All @@ -137,4 +136,4 @@ function deactivate() {}
module.exports = {
activate,
deactivate
}
}

0 comments on commit 8d35dae

Please sign in to comment.