Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
PUBLIC
/
surfer-okd
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit ba93623c
authored
Feb 09, 2017
by
Johannes Zellner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cli help output
1 parent
f173d2d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
cli/actions.js
cli/actions.js
View file @
ba93623
...
@@ -24,7 +24,7 @@ var gQuery = {};
...
@@ -24,7 +24,7 @@ var gQuery = {};
function
checkConfig
()
{
function
checkConfig
()
{
if
(
!
config
.
server
()
||
!
config
.
accessToken
())
{
if
(
!
config
.
server
()
||
!
config
.
accessToken
())
{
console
.
log
(
'
You have run "login" first'
);
console
.
log
(
'
Run %s first'
,
'surfer login'
.
yellow
);
process
.
exit
(
1
);
process
.
exit
(
1
);
}
}
...
@@ -92,9 +92,9 @@ function login(uri) {
...
@@ -92,9 +92,9 @@ function login(uri) {
}
}
function
logout
()
{
function
logout
()
{
checkConfig
(
);
if
(
!
config
.
accessToken
())
return
console
.
log
(
'Done'
.
green
);
superagent
.
post
(
config
.
server
()
+
'/api/logout'
).
query
(
gQuery
).
end
(
function
(
error
,
result
)
{
superagent
.
post
(
config
.
server
()
+
'/api/logout'
).
query
(
{
access_token
:
config
.
accessToken
()
}
).
end
(
function
(
error
,
result
)
{
if
(
result
&&
result
.
statusCode
!==
200
)
console
.
log
(
'Failed to logout: '
+
result
.
statusCode
);
if
(
result
&&
result
.
statusCode
!==
200
)
console
.
log
(
'Failed to logout: '
+
result
.
statusCode
);
if
(
error
)
console
.
log
(
error
);
if
(
error
)
console
.
log
(
error
);
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment