Skip to content
Snippets Groups Projects
Commit ff18f6ff authored by michael.minelli's avatar michael.minelli
Browse files

ExerciseRun => Add verbose mode (display compose output in live)

parent 52a6dd06
No related branches found
No related tags found
No related merge requests found
Pipeline #26551 passed
......@@ -36,6 +36,7 @@ class ExerciseRunCommand extends CommanderCommand {
this.command
.description('locally run an exercise')
.option('-p, --path <value>', 'exercise path', Config.folders.defaultLocalExercise)
.option('-v, --verbose', 'exercise path', Config.folders.defaultLocalExercise)
.action(this.commandAction.bind(this));
}
......@@ -46,7 +47,7 @@ class ExerciseRunCommand extends CommanderCommand {
}).start().info();
}
protected async commandAction(options: any): Promise<void> {
protected async commandAction(options: { path: string, verbose: boolean }): Promise<void> {
const localExercisePath = options.path ?? Config.folders.defaultLocalExercise;
let assignmentFile: AssignmentFile;
......@@ -138,6 +139,14 @@ class ExerciseRunCommand extends CommanderCommand {
await new Promise<void>((resolve, reject) => {
let spinner: ora.Ora;
if ( options.verbose ) {
exerciseDockerCompose.events.on('logs', (log: string, _error: boolean, displayable: boolean) => {
if ( displayable ) {
console.log(log);
}
});
}
exerciseDockerCompose.events.on('step', (name: string, message: string) => {
spinner = ora({
text : message,
......
......@@ -15,7 +15,7 @@ class SessionAppLoginCommand extends CommanderCommand {
.action(this.commandAction.bind(this));
}
protected async commandAction(options: any): Promise<void> {
protected async commandAction(options: { user: string, password: string }): Promise<void> {
if ( !options.password ) {
options.password = (await inquirer.prompt({
type : 'password',
......
......@@ -14,7 +14,7 @@ class SessionGitlabLoginCommand extends CommanderCommand {
.action(this.commandAction.bind(this));
}
protected async commandAction(options: any): Promise<void> {
protected async commandAction(options: { token: string }): Promise<void> {
if ( !options.token ) {
options.token = (await inquirer.prompt({
type : 'password',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment