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 24545229
authored
Mar 01, 2016
by
Johannes Zellner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Require a file argument for delete
1 parent
c9d33e20
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
cli/actions.js
cli/surfer.js
cli/actions.js
View file @
2454522
...
@@ -188,6 +188,7 @@ function del(filePath) {
...
@@ -188,6 +188,7 @@ function del(filePath) {
if
(
error
&&
error
.
status
===
401
)
return
console
.
log
(
'Login failed'
);
if
(
error
&&
error
.
status
===
401
)
return
console
.
log
(
'Login failed'
);
if
(
error
&&
error
.
status
===
404
)
return
console
.
log
(
'No such file or directory'
);
if
(
error
&&
error
.
status
===
404
)
return
console
.
log
(
'No such file or directory'
);
if
(
error
)
return
console
.
log
(
'Failed'
,
result
?
result
.
body
:
error
);
if
(
error
)
return
console
.
log
(
'Failed'
,
result
?
result
.
body
:
error
);
console
.
log
(
'Success'
,
result
.
body
);
console
.
log
(
'Success. Removed %s files.'
,
result
.
body
.
entries
.
length
);
});
});
}
}
cli/surfer.js
View file @
2454522
...
@@ -20,11 +20,11 @@ program.command('put <file> [files...]')
...
@@ -20,11 +20,11 @@ program.command('put <file> [files...]')
.
action
(
actions
.
put
);
.
action
(
actions
.
put
);
program
.
command
(
'get [file]'
)
program
.
command
(
'get [file]'
)
.
description
(
'Get a file or directory'
)
.
description
(
'Get a file or directory
listing
'
)
.
action
(
actions
.
get
);
.
action
(
actions
.
get
);
program
.
command
(
'del'
)
program
.
command
(
'del
<file>
'
)
.
description
(
'Delete a file'
)
.
description
(
'Delete a file
or directory
'
)
.
action
(
actions
.
del
);
.
action
(
actions
.
del
);
program
.
parse
(
process
.
argv
);
program
.
parse
(
process
.
argv
);
...
...
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