Skip to content

Commit 2fe8d62

Browse files
committed
fixed problem with remote path not being correctly uploaded on windows
1 parent 2d8e5bd commit 2fe8d62

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

src/lib/Uploader.ts

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,24 @@ export default class Uploader {
9090
gatheringSpinner.start();
9191

9292
return new Promise((resolve, reject) => {
93-
glob(`**/${globPath}`, { cwd: path.resolve(localPath) }, (err, files) => {
94-
if (err) {
95-
gatheringSpinner.fail(err);
96-
reject(err);
97-
}
98-
99-
gatheringSpinner.succeed(
100-
`Found ${chalk.green(files.length)} files at ${chalk.blue(localPath)}, starting upload:`,
101-
);
102-
103-
resolve(files);
104-
});
93+
glob(
94+
`**/${globPath}`,
95+
{ cwd: path.resolve(localPath) },
96+
(err, files) => {
97+
if (err) {
98+
gatheringSpinner.fail(err);
99+
reject(err);
100+
}
101+
102+
gatheringSpinner.succeed(
103+
`Found ${chalk.green(files.length)} files at ${chalk.blue(
104+
localPath
105+
)}, starting upload:`,
106+
);
107+
108+
resolve(files);
109+
},
110+
);
105111
});
106112
}
107113

@@ -111,7 +117,7 @@ export default class Uploader {
111117

112118
const params = {
113119
Bucket,
114-
Key: remotePath.replace(/\\/, '/'),
120+
Key: remotePath.replace(/\\/g, '/'),
115121
Body: body,
116122
ContentType: mime.getType(localFilePath),
117123
CacheControl: this.getCacheControlValue(localFilePath),

0 commit comments

Comments
 (0)