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

SessionCommand => Move 'session' command to 'auth' command

Keep 'session' command but hidden
parent 88236f24
No related branches found
No related tags found
1 merge request!10Resolve "Add sonar integration"
Pipeline #29643 passed
import { Command, Option } from 'commander';
import SessionCommand from './session/SessionCommand';
import AuthCommand from './auth/AuthCommand';
import ClientsSharedConfig from '../sharedByClients/config/ClientsSharedConfig';
import AssignmentCommand from './assignment/AssignmentCommand';
import ExerciseCommand from './exercise/ExerciseCommand';
......@@ -9,6 +9,7 @@ import { stateConfigFile } from '../config/ConfigFiles';
import semver from 'semver/preload';
import { version } from '../config/Version';
import Config from '../config/Config';
import SessionCommand from './auth/SessionCommand';
class CommanderApp {
......@@ -90,6 +91,7 @@ https://gitedu.hesge.ch/dojo_project/projects/ui/dojocli/-/releases/Latest`, {
}
private registerCommands() {
new AuthCommand().registerOnCommand(this.program);
SessionCommand.registerOnCommand(this.program);
AssignmentCommand.registerOnCommand(this.program);
ExerciseCommand.registerOnCommand(this.program);
......
import CommanderCommand from '../CommanderCommand';
import SessionTestCommand from './subcommands/SessionTestCommand';
import SessionLoginCommand from './subcommands/SessionLoginCommand';
import SessionLogoutCommand from './subcommands/SessionLogoutCommand';
import SessionTestCommand from './subcommands/AuthTestCommand';
import SessionLoginCommand from './subcommands/AuthLoginCommand';
import SessionLogoutCommand from './subcommands/AuthLogoutCommand';
class SessionCommand extends CommanderCommand {
protected commandName: string = 'session';
class AuthCommand extends CommanderCommand {
protected commandName: string = 'auth';
protected defineCommand() {
this.command
......@@ -22,4 +22,4 @@ class SessionCommand extends CommanderCommand {
}
export default new SessionCommand();
\ No newline at end of file
export default AuthCommand;
\ No newline at end of file
import AuthCommand from './AuthCommand';
import { CommandOptions } from 'commander';
class SessionCommand extends AuthCommand {
protected commandName: string = 'session';
protected options: CommandOptions = {
hidden: true
};
}
export default new SessionCommand();
\ No newline at end of file
......@@ -3,7 +3,7 @@ import CommanderCommand from '../../CommanderCommand';
import SessionManager from '../../../managers/SessionManager';
class SessionLoginCommand extends CommanderCommand {
class AuthLoginCommand extends CommanderCommand {
protected commandName: string = 'login';
protected defineCommand() {
......@@ -22,4 +22,4 @@ class SessionLoginCommand extends CommanderCommand {
}
export default new SessionLoginCommand();
\ No newline at end of file
export default new AuthLoginCommand();
\ No newline at end of file
......@@ -4,7 +4,7 @@ import ora from 'ora';
import SessionManager from '../../../managers/SessionManager';
class SessionLogoutCommand extends CommanderCommand {
class AuthLogoutCommand extends CommanderCommand {
protected commandName: string = 'logout';
protected defineCommand() {
......@@ -35,4 +35,4 @@ class SessionLogoutCommand extends CommanderCommand {
}
export default new SessionLogoutCommand();
\ No newline at end of file
export default new AuthLogoutCommand();
\ No newline at end of file
......@@ -3,7 +3,7 @@ import SessionManager from '../../../managers/SessionManager';
import GitlabManager from '../../../managers/GitlabManager';
class SessionTestCommand extends CommanderCommand {
class AuthTestCommand extends CommanderCommand {
protected commandName: string = 'test';
protected defineCommand() {
......@@ -19,4 +19,4 @@ class SessionTestCommand extends CommanderCommand {
}
export default new SessionTestCommand();
\ No newline at end of file
export default new AuthTestCommand();
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment