From d2f5ba3ca27e8d38304139530cb7ff79acb5a188 Mon Sep 17 00:00:00 2001 From: Yorick van Pelt Date: Sun, 23 Apr 2023 09:43:11 +0200 Subject: [PATCH] deployer: use typescript constructor args --- deployer/index.ts | 4 +--- deployer/ssh.ts | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/deployer/index.ts b/deployer/index.ts index bebdcfb..2cae01c 100644 --- a/deployer/index.ts +++ b/deployer/index.ts @@ -99,10 +99,8 @@ function cmd(target: { _commands?: string[] }, propertyKey: string, descripto } class MachineInterface { - machine: Machine _commands?: string[] - constructor(machine: Machine) { - this.machine = machine + constructor(public machine: Machine) { // hack: delete this._commands } diff --git a/deployer/ssh.ts b/deployer/ssh.ts index 57e3c23..95fee51 100644 --- a/deployer/ssh.ts +++ b/deployer/ssh.ts @@ -38,9 +38,8 @@ export async function ssh(host: string, cb?: () => Promise) { } export class SSH { - host: string; child?: ChildProcess | null; - constructor(host: string) { this.host = host } + constructor(public host: string) { } within(cb: () => Promise): Promise { return within(async () => { $.spawn = (command: string, options: any): any => {