ssh2-scp 3.2.0 → 3.2.1

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.
@@ -153,9 +153,15 @@ class SshFs {
153
153
  if (!line || i === 0) continue;
154
154
  const parts = line.split(/\s+/);
155
155
  if (parts.length < 9) continue;
156
- const name = parts.slice(8).join(" ");
157
- if (name === "." || name === "..") continue;
158
156
  const type = parts[0].charAt(0);
157
+ let name = parts.slice(8).join(" ");
158
+ if (type === "l") {
159
+ const arrow = name.indexOf(" -> ");
160
+ if (arrow > 0) {
161
+ name = name.slice(0, arrow);
162
+ }
163
+ }
164
+ if (name === "." || name === "..") continue;
159
165
  const mode = parseModeFromLongname(parts[0]);
160
166
  const owner = parseInt(parts[2], 10);
161
167
  const group = parseInt(parts[3], 10);
@@ -151,9 +151,15 @@ class SshFs {
151
151
  if (!line || i === 0) continue;
152
152
  const parts = line.split(/\s+/);
153
153
  if (parts.length < 9) continue;
154
- const name = parts.slice(8).join(" ");
155
- if (name === "." || name === "..") continue;
156
154
  const type = parts[0].charAt(0);
155
+ let name = parts.slice(8).join(" ");
156
+ if (type === "l") {
157
+ const arrow = name.indexOf(" -> ");
158
+ if (arrow > 0) {
159
+ name = name.slice(0, arrow);
160
+ }
161
+ }
162
+ if (name === "." || name === "..") continue;
157
163
  const mode = parseModeFromLongname(parts[0]);
158
164
  const owner = parseInt(parts[2], 10);
159
165
  const group = parseInt(parts[3], 10);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ssh2-scp",
3
- "version": "3.2.0",
3
+ "version": "3.2.1",
4
4
  "description": "Remote file system operations over SSH2 session without SFTP",
5
5
  "scripts": {
6
6
  "build": "npm run build:esm && npm run build:cjs",