mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 10:09:04 +00:00
fix(put) unzip only if query
This commit is contained in:
parent
bbf81a756a
commit
1cdf63bc22
1 changed files with 13 additions and 2 deletions
|
|
@ -22,6 +22,17 @@
|
|||
baseName = path.basename(name);
|
||||
|
||||
switch(query) {
|
||||
default:
|
||||
pipe.create(readStream, name, function(error) {
|
||||
var msg;
|
||||
|
||||
if (!error)
|
||||
msg = CloudFunc.formatMsg('save', baseName);
|
||||
|
||||
func(error, msg);
|
||||
});
|
||||
break;
|
||||
|
||||
case 'dir':
|
||||
flop.create(name, 'dir', function(error) {
|
||||
var msg;
|
||||
|
|
@ -38,12 +49,12 @@
|
|||
fs.writeFile(name, '', callback);
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'unzip':
|
||||
pack.gunzip(readStream, name, function(error) {
|
||||
var msg;
|
||||
|
||||
if (!error)
|
||||
msg = CloudFunc.formatMsg('save', baseName);
|
||||
msg = CloudFunc.formatMsg('save (unzip)', baseName);
|
||||
|
||||
func(error, msg);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue