ssh2-scp 3.3.1 → 3.3.2
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 +7 -5
- package/dist/esm/ssh-fs.js +7 -5
- package/package.json +1 -1
package/dist/cjs/ssh-fs.cjs
CHANGED
|
@@ -143,11 +143,13 @@ class SshFs {
|
|
|
143
143
|
async readListings(remotePath, flags) {
|
|
144
144
|
const operand = remotePath.startsWith("-") ? "./" + remotePath : remotePath;
|
|
145
145
|
const path = "'" + operand.replace(/'/g, "'\\''") + "'";
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
146
|
+
const script = [
|
|
147
|
+
'if [ -n "$LC_ALL" ]; then export LC_CTYPE="$LC_ALL"; unset LC_ALL; fi',
|
|
148
|
+
"export LC_TIME=C TZ=UTC0",
|
|
149
|
+
'if ls -d --full-time / >/dev/null 2>&1; then full=--full-time; elif [ "$(ls -dT / 2>/dev/null)" = / ]; then full=-T; else full=; fi',
|
|
150
|
+
// Only the probed option may expand to zero arguments. Always quote the path.
|
|
151
|
+
`ls -${flags} $full "$1" && printf "\\000" && ls -${flags}u $full "$1"`
|
|
152
|
+
].join("; ");
|
|
151
153
|
const output = await this.runCmd(`sh -c '${script}' sh ${path}`);
|
|
152
154
|
const [modified, accessed = ""] = output.split("\0");
|
|
153
155
|
return { entries: parseListing(modified), accessed: parseListing(accessed) };
|
package/dist/esm/ssh-fs.js
CHANGED
|
@@ -141,11 +141,13 @@ class SshFs {
|
|
|
141
141
|
async readListings(remotePath, flags) {
|
|
142
142
|
const operand = remotePath.startsWith("-") ? "./" + remotePath : remotePath;
|
|
143
143
|
const path = "'" + operand.replace(/'/g, "'\\''") + "'";
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
144
|
+
const script = [
|
|
145
|
+
'if [ -n "$LC_ALL" ]; then export LC_CTYPE="$LC_ALL"; unset LC_ALL; fi',
|
|
146
|
+
"export LC_TIME=C TZ=UTC0",
|
|
147
|
+
'if ls -d --full-time / >/dev/null 2>&1; then full=--full-time; elif [ "$(ls -dT / 2>/dev/null)" = / ]; then full=-T; else full=; fi',
|
|
148
|
+
// Only the probed option may expand to zero arguments. Always quote the path.
|
|
149
|
+
`ls -${flags} $full "$1" && printf "\\000" && ls -${flags}u $full "$1"`
|
|
150
|
+
].join("; ");
|
|
149
151
|
const output = await this.runCmd(`sh -c '${script}' sh ${path}`);
|
|
150
152
|
const [modified, accessed = ""] = output.split("\0");
|
|
151
153
|
return { entries: parseListing(modified), accessed: parseListing(accessed) };
|