Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DojoCLI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dojo Project (HES-SO)
Projects
UI
DojoCLI
Commits
60b0aaa0
Commit
60b0aaa0
authored
1 year ago
by
michael.minelli
Browse files
Options
Downloads
Patches
Plain Diff
Sesssion => gilab: move token from param to option
parent
f582a479
No related branches found
No related tags found
No related merge requests found
Pipeline
#26546
passed
1 year ago
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
NodeApp/src/commander/session/Gitlab/SessionGitlabLoginCommand.ts
+13
-3
13 additions, 3 deletions
...src/commander/session/Gitlab/SessionGitlabLoginCommand.ts
with
13 additions
and
3 deletions
NodeApp/src/commander/session/Gitlab/SessionGitlabLoginCommand.ts
+
13
−
3
View file @
60b0aaa0
import
chalk
from
'
chalk
'
;
import
chalk
from
'
chalk
'
;
import
CommanderCommand
from
'
../../CommanderCommand
'
;
import
CommanderCommand
from
'
../../CommanderCommand
'
;
import
GitlabManager
from
'
../../../managers/GitlabManager
'
;
import
GitlabManager
from
'
../../../managers/GitlabManager
'
;
import
inquirer
from
'
inquirer
'
;
class
SessionGitlabLoginCommand
extends
CommanderCommand
{
class
SessionGitlabLoginCommand
extends
CommanderCommand
{
...
@@ -9,14 +10,23 @@ class SessionGitlabLoginCommand extends CommanderCommand {
...
@@ -9,14 +10,23 @@ class SessionGitlabLoginCommand extends CommanderCommand {
protected
defineCommand
()
{
protected
defineCommand
()
{
this
.
command
this
.
command
.
description
(
'
register the gitlab token
'
)
.
description
(
'
register the gitlab token
'
)
.
argument
(
'
<token
>
'
,
'
personal access token from GitLab with api scope
'
)
.
option
(
'
-t, --token <string
>
'
,
'
personal access token from GitLab with api scope
'
)
.
action
(
this
.
commandAction
.
bind
(
this
));
.
action
(
this
.
commandAction
.
bind
(
this
));
}
}
protected
async
commandAction
(
token
:
string
):
Promise
<
void
>
{
protected
async
commandAction
(
options
:
any
):
Promise
<
void
>
{
if
(
!
options
.
token
)
{
options
.
token
=
(
await
inquirer
.
prompt
({
type
:
'
password
'
,
name
:
'
token
'
,
message
:
'
Please enter your gitlab token
'
,
mask
:
''
})).
token
;
}
console
.
log
(
chalk
.
cyan
(
'
Please wait while we are testing your Gitlab token...
'
));
console
.
log
(
chalk
.
cyan
(
'
Please wait while we are testing your Gitlab token...
'
));
GitlabManager
.
login
(
token
);
GitlabManager
.
login
(
options
.
token
);
await
GitlabManager
.
testToken
();
await
GitlabManager
.
testToken
();
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment