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 { Command, Option } from 'commander';
import SessionCommand from './session/SessionCommand'; import AuthCommand from './auth/AuthCommand';
import ClientsSharedConfig from '../sharedByClients/config/ClientsSharedConfig'; import ClientsSharedConfig from '../sharedByClients/config/ClientsSharedConfig';
import AssignmentCommand from './assignment/AssignmentCommand'; import AssignmentCommand from './assignment/AssignmentCommand';
import ExerciseCommand from './exercise/ExerciseCommand'; import ExerciseCommand from './exercise/ExerciseCommand';
...@@ -9,6 +9,7 @@ import { stateConfigFile } from '../config/ConfigFiles'; ...@@ -9,6 +9,7 @@ import { stateConfigFile } from '../config/ConfigFiles';
import semver from 'semver/preload'; import semver from 'semver/preload';
import { version } from '../config/Version'; import { version } from '../config/Version';
import Config from '../config/Config'; import Config from '../config/Config';
import SessionCommand from './auth/SessionCommand';
class CommanderApp { class CommanderApp {
...@@ -90,6 +91,7 @@ https://gitedu.hesge.ch/dojo_project/projects/ui/dojocli/-/releases/Latest`, { ...@@ -90,6 +91,7 @@ https://gitedu.hesge.ch/dojo_project/projects/ui/dojocli/-/releases/Latest`, {
} }
private registerCommands() { private registerCommands() {
new AuthCommand().registerOnCommand(this.program);
SessionCommand.registerOnCommand(this.program); SessionCommand.registerOnCommand(this.program);
AssignmentCommand.registerOnCommand(this.program); AssignmentCommand.registerOnCommand(this.program);
ExerciseCommand.registerOnCommand(this.program); ExerciseCommand.registerOnCommand(this.program);
......
import CommanderCommand from '../CommanderCommand'; import CommanderCommand from '../CommanderCommand';
import SessionTestCommand from './subcommands/SessionTestCommand'; import SessionTestCommand from './subcommands/AuthTestCommand';
import SessionLoginCommand from './subcommands/SessionLoginCommand'; import SessionLoginCommand from './subcommands/AuthLoginCommand';
import SessionLogoutCommand from './subcommands/SessionLogoutCommand'; import SessionLogoutCommand from './subcommands/AuthLogoutCommand';
class SessionCommand extends CommanderCommand { class AuthCommand extends CommanderCommand {
protected commandName: string = 'session'; protected commandName: string = 'auth';
protected defineCommand() { protected defineCommand() {
this.command this.command
...@@ -22,4 +22,4 @@ class SessionCommand extends CommanderCommand { ...@@ -22,4 +22,4 @@ class SessionCommand extends CommanderCommand {
} }
export default new SessionCommand(); export default AuthCommand;
\ No newline at end of file \ 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'; ...@@ -3,7 +3,7 @@ import CommanderCommand from '../../CommanderCommand';
import SessionManager from '../../../managers/SessionManager'; import SessionManager from '../../../managers/SessionManager';
class SessionLoginCommand extends CommanderCommand { class AuthLoginCommand extends CommanderCommand {
protected commandName: string = 'login'; protected commandName: string = 'login';
protected defineCommand() { protected defineCommand() {
...@@ -22,4 +22,4 @@ class SessionLoginCommand extends CommanderCommand { ...@@ -22,4 +22,4 @@ class SessionLoginCommand extends CommanderCommand {
} }
export default new SessionLoginCommand(); export default new AuthLoginCommand();
\ No newline at end of file \ No newline at end of file
...@@ -4,7 +4,7 @@ import ora from 'ora'; ...@@ -4,7 +4,7 @@ import ora from 'ora';
import SessionManager from '../../../managers/SessionManager'; import SessionManager from '../../../managers/SessionManager';
class SessionLogoutCommand extends CommanderCommand { class AuthLogoutCommand extends CommanderCommand {
protected commandName: string = 'logout'; protected commandName: string = 'logout';
protected defineCommand() { protected defineCommand() {
...@@ -35,4 +35,4 @@ class SessionLogoutCommand extends CommanderCommand { ...@@ -35,4 +35,4 @@ class SessionLogoutCommand extends CommanderCommand {
} }
export default new SessionLogoutCommand(); export default new AuthLogoutCommand();
\ No newline at end of file \ No newline at end of file
...@@ -3,7 +3,7 @@ import SessionManager from '../../../managers/SessionManager'; ...@@ -3,7 +3,7 @@ import SessionManager from '../../../managers/SessionManager';
import GitlabManager from '../../../managers/GitlabManager'; import GitlabManager from '../../../managers/GitlabManager';
class SessionTestCommand extends CommanderCommand { class AuthTestCommand extends CommanderCommand {
protected commandName: string = 'test'; protected commandName: string = 'test';
protected defineCommand() { protected defineCommand() {
...@@ -19,4 +19,4 @@ class SessionTestCommand extends CommanderCommand { ...@@ -19,4 +19,4 @@ class SessionTestCommand extends CommanderCommand {
} }
export default new SessionTestCommand(); export default new AuthTestCommand();
\ No newline at end of file \ 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