diff --git a/src/action/action.ts b/src/action/action.ts index 0258bd2..8192231 100644 --- a/src/action/action.ts +++ b/src/action/action.ts @@ -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() + } } } @@ -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()} ) } diff --git a/src/vm.ts b/src/vm.ts index 090cae6..6974b12 100644 --- a/src/vm.ts +++ b/src/vm.ts @@ -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 { + async execute2( + args: string[], + intput: Buffer, + options: ExecuteOptions = {} + ): Promise { + 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} ) }