office: promise an attach line only when a session was actually built
This commit is contained in:
10
bin/office
10
bin/office
@@ -364,8 +364,6 @@ def run_on_remote(host, folder, opts):
|
||||
sys.stdout.write(out.stdout)
|
||||
if out.returncode != 0:
|
||||
raise h.Refused(3, "the other machine refused: %s" % (out.stderr or out.stdout).strip()[:300])
|
||||
h.say("")
|
||||
h.say("switch to it: tuios attach --host %s %s" % (host, opts["session"] or os.path.basename(folder)))
|
||||
return 0
|
||||
|
||||
|
||||
@@ -786,6 +784,14 @@ def main():
|
||||
sys.executable,
|
||||
[sys.executable, os.path.join(HERE, "board"), "--folder", folder],
|
||||
)
|
||||
if code == 0:
|
||||
# Only now is there a session worth attaching to. Promising one earlier
|
||||
# is how a person ends up trying to attach to a session that was never
|
||||
# created, because the project was still waiting for its first commit.
|
||||
client = opts.get("client_host") or ""
|
||||
h.say("")
|
||||
h.say("switch to it: tuios attach%s %s"
|
||||
% (" --host " + client if client else "", session))
|
||||
return code
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user