Skip to content

Commit f3cab1a

Browse files
fix: upload could only upload to non-existant folder
1 parent 71922fa commit f3cab1a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Device.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,9 @@ class Device {
491491
* }} options
492492
*/
493493
async upload(source, destination, options) {
494-
destination = posix.join(this.config.rootPath, `/${destination}`.replace(/\/+/g, "/"));
495-
await this.adapter.mkdirs(destination.replace(/\/.+?$/, ""));
494+
destination = posix.join(this.config.rootPath, destination.replace(/[\/\\]+/g, "/"));
495+
await this.adapter.mkdirs(dirname(destination));
496+
496497
const root = source;
497498
const ignores = [...this.pymakr.config.get().get("ignore")];
498499
const pymakrConfig = getNearestPymakrConfig(source);

0 commit comments

Comments
 (0)