Fix remote deploy console encoding; allow npm install without lock.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -54,12 +54,23 @@ curl -fsS http://127.0.0.1:5155/health || true
|
|||||||
client.connect(HOST, username=USER, password=PASSWORD, timeout=30)
|
client.connect(HOST, username=USER, password=PASSWORD, timeout=30)
|
||||||
print("running remote bootstrap/pull ...")
|
print("running remote bootstrap/pull ...")
|
||||||
stdin, stdout, stderr = client.exec_command(remote, get_pty=True)
|
stdin, stdout, stderr = client.exec_command(remote, get_pty=True)
|
||||||
for line in iter(stdout.readline, ""):
|
while True:
|
||||||
print(line, end="")
|
chunk = stdout.read(1024)
|
||||||
err = stderr.read().decode("utf-8", errors="ignore")
|
if not chunk:
|
||||||
|
break
|
||||||
|
text = chunk.decode("utf-8", errors="replace") if isinstance(chunk, bytes) else chunk
|
||||||
|
try:
|
||||||
|
print(text, end="", flush=True)
|
||||||
|
except UnicodeEncodeError:
|
||||||
|
print(text.encode("ascii", errors="replace").decode("ascii"), end="", flush=True)
|
||||||
|
err_raw = stderr.read()
|
||||||
|
err = err_raw.decode("utf-8", errors="replace") if isinstance(err_raw, bytes) else err_raw
|
||||||
code = stdout.channel.recv_exit_status()
|
code = stdout.channel.recv_exit_status()
|
||||||
if err:
|
if err:
|
||||||
|
try:
|
||||||
print(err, file=sys.stderr)
|
print(err, file=sys.stderr)
|
||||||
|
except UnicodeEncodeError:
|
||||||
|
print(err.encode("ascii", errors="replace").decode("ascii"), file=sys.stderr)
|
||||||
client.close()
|
client.close()
|
||||||
print(f"exit={code}")
|
print(f"exit={code}")
|
||||||
return code
|
return code
|
||||||
|
|||||||
Reference in New Issue
Block a user