mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-19 09:24:51 +00:00
feature(rest) onPUT: add WIN32_ROOT_MSG
This commit is contained in:
parent
b1387bc941
commit
f79001b972
1 changed files with 9 additions and 3 deletions
|
|
@ -268,7 +268,9 @@
|
|||
*/
|
||||
function onPUT(params) {
|
||||
var p, cmd, files, name, json, config, data, from, to,
|
||||
ret = main.checkParams(params, ['body']);
|
||||
|
||||
WIN32_ROOT_MSG = 'Could not copy to root on windows!',
|
||||
ret = main.checkParams(params, ['body']);
|
||||
|
||||
if (ret) {
|
||||
p = params,
|
||||
|
|
@ -289,8 +291,10 @@
|
|||
break;
|
||||
|
||||
case 'mv':
|
||||
if (!files.from || !files.to || isRootWin32(files.to)) {
|
||||
if (!files.from || !files.to) {
|
||||
sendError(params, p.data);
|
||||
} else if (isRootWin32(files.to)) {
|
||||
sendError(params, WIN32_ROOT_MSG);
|
||||
} else {
|
||||
files.from = mellow.convertPath(files.from);
|
||||
files.to = mellow.convertPath(files.to);
|
||||
|
|
@ -311,8 +315,10 @@
|
|||
break;
|
||||
|
||||
case 'cp':
|
||||
if (!files.from || !files.names || !files.to || isRootWin32(files.to)) {
|
||||
if (!files.from || !files.names || !files.to) {
|
||||
sendError(params, p.data);
|
||||
} else if (isRootWin32(files.to)) {
|
||||
sendError(params, WIN32_ROOT_MSG);
|
||||
} else {
|
||||
files.from = mellow.convertPath(files.from);
|
||||
files.to = mellow.convertPath(files.to);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue