diff --git a/src/cloud189.ts b/src/cloud189.ts index 8af8abf..c945d1d 100644 --- a/src/cloud189.ts +++ b/src/cloud189.ts @@ -44,7 +44,7 @@ function uploadToRemote(fileName: string, category: string): boolean { log(`Info:Uploading ${fileName}`); // 先尝试移除这个文件 deleteFromRemote(fileName, category, true); - cp.execSync(`cloud189 up "${localPath}" ${remotePath}`); + cp.execSync(`cloud189 up "${localPath}" "${remotePath}"`); } catch (err: any) { console.log(err?.output.toString()); date = new Date(); @@ -86,7 +86,7 @@ function deleteFromRemote( // 读取远程目录查看是否存在 let buf; try { - buf = cp.execSync(`cloud189 ls ${config.REMOTE_PATH}/${category}`); + buf = cp.execSync(`cloud189 ls "${config.REMOTE_PATH}/${category}"`); } catch (err: any) { console.log(err?.output.toString()); log( diff --git a/src/rclone.ts b/src/rclone.ts index 8b2c1ca..cfe58b1 100644 --- a/src/rclone.ts +++ b/src/rclone.ts @@ -26,7 +26,7 @@ function uploadToRemote(fileName: string, category: string): boolean { try { log(`Info:Uploading ${fileName}`); cp.execSync( - `rclone copy "${localPath}" ${config.REMOTE_NAME}:${remotePath}`, + `rclone copy "${localPath}" "${config.REMOTE_NAME}:${remotePath}"`, getOptions(3600000), ); } catch (err: any) { @@ -71,7 +71,7 @@ function deleteFromRemote( let buf; try { buf = cp.execSync( - `rclone ls ${config.REMOTE_NAME}:${config.REMOTE_PATH}/${category}`, + `rclone ls "${config.REMOTE_NAME}:${config.REMOTE_PATH}/${category}"`, getOptions(10000), ); } catch (err: any) {