@neoline/hostbridge 1.4.2 → 1.4.3
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/package.json
CHANGED
package/pyproject.toml
CHANGED
|
@@ -255,12 +255,14 @@ class HostBridgeSFTPServer(asyncssh.SFTPServer):
|
|
|
255
255
|
self._checked_run(f"mv -- {shlex.quote(self._path(oldpath))} {shlex.quote(self._path(newpath))}")
|
|
256
256
|
|
|
257
257
|
def realpath(self, path: bytes) -> bytes:
|
|
258
|
-
|
|
259
|
-
"
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
258
|
+
script = (
|
|
259
|
+
"import os,sys; "
|
|
260
|
+
"path=sys.argv[1]; "
|
|
261
|
+
"parent=os.path.dirname(path) or '/'; "
|
|
262
|
+
"base=os.path.basename(path); "
|
|
263
|
+
"print(os.path.join(os.path.realpath(parent), base) if not os.path.exists(path) else os.path.realpath(path))"
|
|
263
264
|
)
|
|
265
|
+
command = "python3 -c " + shlex.quote(script) + " " + shlex.quote(self._path(path))
|
|
264
266
|
result = self._checked_run(command)
|
|
265
267
|
return (result.output.strip() or self._path(path)).encode("utf-8")
|
|
266
268
|
|