-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
01256d2
commit 6be3ddf
Showing
828 changed files
with
4,464 additions
and
4,891 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
import { Cli, CommandOutput } from "./cli/Cli.js"; | ||
import { CommandOutput, cli } from "./cli/cli.js"; | ||
|
||
export async function executeCommand(commandName: string, options: any, listener?: { | ||
stdout: (message: any) => void, | ||
stderr: (message: any) => void, | ||
}): Promise<CommandOutput> { | ||
const cli = Cli.getInstance(); | ||
cli.loadAllCommandsInfo(); | ||
await cli.loadCommandFromArgs(commandName.split(' ')); | ||
if (!cli.commandToExecute) { | ||
return Promise.reject(`Command not found: ${commandName}`); | ||
} | ||
|
||
return Cli.executeCommandWithOutput(cli.commandToExecute.command, { options: options ?? {} }, listener); | ||
return cli.executeCommandWithOutput(cli.commandToExecute.command, { options: options ?? {} }, listener); | ||
} |
Oops, something went wrong.