mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-19 01:17:18 +00:00
feature(rest) add getWin32RootMsg
This commit is contained in:
parent
f79001b972
commit
84e40e95f8
1 changed files with 15 additions and 4 deletions
|
|
@ -268,8 +268,6 @@
|
|||
*/
|
||||
function onPUT(params) {
|
||||
var p, cmd, files, name, json, config, data, from, to,
|
||||
|
||||
WIN32_ROOT_MSG = 'Could not copy to root on windows!',
|
||||
ret = main.checkParams(params, ['body']);
|
||||
|
||||
if (ret) {
|
||||
|
|
@ -294,7 +292,9 @@
|
|||
if (!files.from || !files.to) {
|
||||
sendError(params, p.data);
|
||||
} else if (isRootWin32(files.to)) {
|
||||
sendError(params, WIN32_ROOT_MSG);
|
||||
sendError(params, getWin32RooMsg('to'));
|
||||
} else if (isRootWin32(files.from)) {
|
||||
sendError(params, getWin32RooMsg('from'));
|
||||
} else {
|
||||
files.from = mellow.convertPath(files.from);
|
||||
files.to = mellow.convertPath(files.to);
|
||||
|
|
@ -318,7 +318,9 @@
|
|||
if (!files.from || !files.names || !files.to) {
|
||||
sendError(params, p.data);
|
||||
} else if (isRootWin32(files.to)) {
|
||||
sendError(params, WIN32_ROOT_MSG);
|
||||
sendError(params, getWin32RooMsg('to'));
|
||||
} else if (isRootWin32(files.from)) {
|
||||
sendError(params, getWin32RooMsg('from'));
|
||||
} else {
|
||||
files.from = mellow.convertPath(files.from);
|
||||
files.to = mellow.convertPath(files.to);
|
||||
|
|
@ -450,6 +452,15 @@
|
|||
return isWin32 && isRoot;
|
||||
}
|
||||
|
||||
function getWin32RooMsg(direction) {
|
||||
var messageRaw = 'Could not copy {{ direction }} root on windows!',
|
||||
message = Util.render(messageRaw, {
|
||||
direction: direction
|
||||
});
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
function sendMsg(sendParam, msgParam, dataParam, status) {
|
||||
var msg, data,
|
||||
isObj = Util.isObject(dataParam);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue