Skip to content

Commit

Permalink
fixup! Fix #49: Hide most output behind output groups
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-carlborg committed Mar 4, 2023
1 parent a109f9a commit 2fcee9d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
12 changes: 8 additions & 4 deletions src/action/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,12 @@ export class Action {
await vm.stop()
}
} finally {
core.endGroup()
await vm.terminate()
fs.rmdirSync(this.tempPath, {recursive: true})
try {
await vm.terminate()
fs.rmdirSync(this.tempPath, {recursive: true})
} finally {
core.endGroup()
}
}
}

Expand Down Expand Up @@ -271,7 +274,8 @@ export class Action {
'-c',
`'cd "${process.env['GITHUB_WORKSPACE']}" && exec "${sh}" -e'`
],
Buffer.from(this.input.run)
Buffer.from(this.input.run),
{silent: !core.isDebug()}
)
}

Expand Down
13 changes: 9 additions & 4 deletions src/vm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,21 @@ export abstract class Vm {

return await exec.exec('ssh', ['-t', `${Vm.user}@${this.ipAddress}`], {
input: buffer,
silent: options.silent,
ignoreReturnCode: options.ignoreReturnCode
...options
})
}

async execute2(args: string[], intput: Buffer): Promise<number> {
async execute2(
args: string[],
intput: Buffer,
options: ExecuteOptions = {}
): Promise<number> {
const defaultOptions = {silent: !core.isDebug()}
options = {...defaultOptions, ...options}
return await exec.exec(
'ssh',
['-t', `${Vm.user}@${this.ipAddress}`].concat(args),
{input: intput}
{input: intput, ...options}
)
}

Expand Down

0 comments on commit 2fcee9d

Please sign in to comment.