ssh2-scp 3.0.1 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ssh-fs.cjs +6 -3
- package/dist/esm/ssh-fs.d.ts +1 -0
- package/dist/esm/ssh-fs.js +6 -3
- package/dist/esm/transfer.d.ts +1 -0
- package/package.json +1 -1
package/dist/cjs/ssh-fs.cjs
CHANGED
|
@@ -16,6 +16,9 @@ class SshFs {
|
|
|
16
16
|
getExecOpts() {
|
|
17
17
|
return {};
|
|
18
18
|
}
|
|
19
|
+
maskMode(mode) {
|
|
20
|
+
return mode & 4095;
|
|
21
|
+
}
|
|
19
22
|
getMonthIndex(month) {
|
|
20
23
|
const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
21
24
|
return months.indexOf(month);
|
|
@@ -181,7 +184,7 @@ class SshFs {
|
|
|
181
184
|
return this.listFiles(remotePath);
|
|
182
185
|
}
|
|
183
186
|
async mkdir(remotePath, options = {}) {
|
|
184
|
-
const cmd = options.mode ? `mkdir -m ${options.mode.toString(8)} -p "${remotePath}"` : `mkdir -p "${remotePath}"`;
|
|
187
|
+
const cmd = options.mode ? `mkdir -m ${this.maskMode(options.mode).toString(8)} -p "${remotePath}"` : `mkdir -p "${remotePath}"`;
|
|
185
188
|
return this.runCmd(cmd);
|
|
186
189
|
}
|
|
187
190
|
async stat(remotePath) {
|
|
@@ -276,7 +279,7 @@ class SshFs {
|
|
|
276
279
|
};
|
|
277
280
|
}
|
|
278
281
|
chmod(remotePath, mode) {
|
|
279
|
-
return this.runCmd(`chmod ${mode.toString(8)} "${remotePath}"`);
|
|
282
|
+
return this.runCmd(`chmod ${this.maskMode(mode).toString(8)} "${remotePath}"`);
|
|
280
283
|
}
|
|
281
284
|
rename(remotePath, remotePathNew) {
|
|
282
285
|
return this.runCmd(`mv "${remotePath}" "${remotePathNew}"`);
|
|
@@ -336,7 +339,7 @@ class SshFs {
|
|
|
336
339
|
}
|
|
337
340
|
}
|
|
338
341
|
if (mode) {
|
|
339
|
-
await this.runCmd(`chmod ${mode.toString(8)} "${remotePath}"`);
|
|
342
|
+
await this.runCmd(`chmod ${this.maskMode(mode).toString(8)} "${remotePath}"`);
|
|
340
343
|
}
|
|
341
344
|
}
|
|
342
345
|
}
|
package/dist/esm/ssh-fs.d.ts
CHANGED
package/dist/esm/ssh-fs.js
CHANGED
|
@@ -14,6 +14,9 @@ class SshFs {
|
|
|
14
14
|
getExecOpts() {
|
|
15
15
|
return {};
|
|
16
16
|
}
|
|
17
|
+
maskMode(mode) {
|
|
18
|
+
return mode & 4095;
|
|
19
|
+
}
|
|
17
20
|
getMonthIndex(month) {
|
|
18
21
|
const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
19
22
|
return months.indexOf(month);
|
|
@@ -179,7 +182,7 @@ class SshFs {
|
|
|
179
182
|
return this.listFiles(remotePath);
|
|
180
183
|
}
|
|
181
184
|
async mkdir(remotePath, options = {}) {
|
|
182
|
-
const cmd = options.mode ? `mkdir -m ${options.mode.toString(8)} -p "${remotePath}"` : `mkdir -p "${remotePath}"`;
|
|
185
|
+
const cmd = options.mode ? `mkdir -m ${this.maskMode(options.mode).toString(8)} -p "${remotePath}"` : `mkdir -p "${remotePath}"`;
|
|
183
186
|
return this.runCmd(cmd);
|
|
184
187
|
}
|
|
185
188
|
async stat(remotePath) {
|
|
@@ -274,7 +277,7 @@ class SshFs {
|
|
|
274
277
|
};
|
|
275
278
|
}
|
|
276
279
|
chmod(remotePath, mode) {
|
|
277
|
-
return this.runCmd(`chmod ${mode.toString(8)} "${remotePath}"`);
|
|
280
|
+
return this.runCmd(`chmod ${this.maskMode(mode).toString(8)} "${remotePath}"`);
|
|
278
281
|
}
|
|
279
282
|
rename(remotePath, remotePathNew) {
|
|
280
283
|
return this.runCmd(`mv "${remotePath}" "${remotePathNew}"`);
|
|
@@ -334,7 +337,7 @@ class SshFs {
|
|
|
334
337
|
}
|
|
335
338
|
}
|
|
336
339
|
if (mode) {
|
|
337
|
-
await this.runCmd(`chmod ${mode.toString(8)} "${remotePath}"`);
|
|
340
|
+
await this.runCmd(`chmod ${this.maskMode(mode).toString(8)} "${remotePath}"`);
|
|
338
341
|
}
|
|
339
342
|
}
|
|
340
343
|
}
|
package/dist/esm/transfer.d.ts
CHANGED