Skip to content

Commit 42d68d8

Browse files
committed
Ignore result of commands starting with ?
1 parent b4ed3f2 commit 42d68d8

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

action-runner/dist/index.js

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

action-runner/src/main.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,22 @@ export async function onMessage(ws: WebSocket, msg: any) {
3939
userHome: await determineUserHome()
4040
}))
4141
} else if (json.type == "command") {
42-
const command = json.command
42+
const command: string[] = json.command
4343

4444
console.error(`Executing "${command.join(' ')}"\n`)
4545

46-
const cmdLine = command.shift()
46+
let cmdLine = command.shift()!
47+
const optional = cmdLine.startsWith("?")
48+
if (optional) {
49+
cmdLine = cmdLine.substring(1)
50+
}
51+
4752
currentCommand = exec.getExecOutput(cmdLine, command, {
4853
cwd: workspace,
4954
ignoreReturnCode: true
5055
})
5156
.then(executed => {
52-
if (executed.exitCode != 0) {
57+
if (!optional && executed.exitCode != 0) {
5358
ws.send(JSON.stringify({
5459
stderr: executed.stderr
5560
}))

0 commit comments

Comments
 (0)