( flyctlArgs: string[], cmdOptions: CmdCmdOptions, )
| 13 | // Runs a command by copying down the project toml files, executing it, and copying it back up (just in case). |
| 14 | // If the toml file does not exist, some commands will not run with additional args (e.g. -a <appname>). |
| 15 | export async function cmd( |
| 16 | flyctlArgs: string[], |
| 17 | cmdOptions: CmdCmdOptions, |
| 18 | ): Promise<void> { |
| 19 | if (cmdOptions.org) { |
| 20 | flyctlArgs.push("--org", cmdOptions.org); |
| 21 | } |
| 22 | |
| 23 | waspSays( |
| 24 | `Running ${cmdOptions.context} command: flyctl ${flyctlArgs.join(" ")}`, |
| 25 | ); |
| 26 | |
| 27 | await ensureWaspProjectIsBuilt(cmdOptions); |
| 28 | |
| 29 | const tomlFilePaths = getTomlFilePaths(cmdOptions); |
| 30 | const commonOps = getCommonOps( |
| 31 | cmdOptions.context, |
| 32 | cmdOptions.waspProjectDir, |
| 33 | tomlFilePaths, |
| 34 | ); |
| 35 | |
| 36 | await runFlyctlCommand(commonOps, flyctlArgs); |
| 37 | } |
| 38 | |
| 39 | async function runFlyctlCommand( |
| 40 | commonOps: CommonOps, |
nothing calls this directly
no test coverage detected