Skip to content

Commit e5750b1

Browse files
committed
fix: 修复windows平台上传失败问题
1.目录分割�替换成"/"
1 parent 581ccbf commit e5750b1

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

bin/cshell.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var program = require("commander");
33
var colors = require("colors");
44

55
program
6-
.version("2.0.3")
6+
.version("2.0.4")
77
.usage("[command] [option]")
88
.command("upload", "upload files")
99
.command("download", "download files")

lib/scripts/upload.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,9 @@ function fileDisplay(filePath) {
8080
const isFile = stats.isFile();
8181
const isDir = stats.isDirectory();
8282
if (isFile) {
83-
const fileName = filedir.replace(
84-
`${originDirectoryPath}${path.sep}`,
85-
""
86-
);
87-
// .replace(/\\/g, "/");
83+
const fileName = filedir
84+
.replace(`${originDirectoryPath}${path.sep}`, "")
85+
.replace(/\\/g, "/");
8886
uploadFile(filedir, fileName, prefix);
8987
} else if (isDir) {
9088
fileDisplay(filedir);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "qiniu-shell",
3-
"version": "2.0.3",
3+
"version": "2.0.4",
44
"description": "A tool of qiniu's file operation",
55
"main": "index.js",
66
"keywords": [

0 commit comments

Comments
 (0)