Versions 155 to 156
Lines 3–12 at 156 (were 3–14 at 155)
33// when one fails. Neither prints a credential. plainError words the commonest failures the same way.
44
6−import { UsageError } from "./args.ts";
76import { type Answer, type BoxRecord, boxGet, boxText, originOf, readBox, signedInServers } from "./box.ts";
10−import { TOKEN_SERVERS } from "./core.ts";
11−import { fromEnv } from "./env-names.ts";
1210
1311/** The lowest Node major each kind of copy runs on: the npm package is built for 20, a checkout runs its .ts as is. */
Lines 41–53 at 156 (were 43–67 at 155)
4442
46− * The server whoami and doctor look at, in the order join picks one: --server, then ABSO_SERVER, then this
47− * folder's server, then the one this box signed in to with abso login, then https://api.abso.dev. A box signed
48− * in to more than one server has to say which.
44+ * The servers other than `server` this box is signed in to, as one sentence for a refusal or a report to end
50−export function checkServer(
51− flag: string | undefined,
52− cwd: string,
53− env: Readonly<Record<string, string | undefined>>,
54− home?: string,
55− now = Date.now(),
56−): string {
57− const named = flag ?? fromEnv(env, "SERVER");
58− if (named) return named;
59− const folder = folderOf(cwd, env)?.config?.server;
60− if (folder) return folder;
61− const signedIn = signedInServers(home, now);
62− if (signedIn.length > 1)
63− throw new UsageError(`this box is signed in to ${signedIn.join(" and ")}: say which with --server <url>`);
64− return signedIn[0] ?? TOKEN_SERVERS[0]!;
47+export function elsewhereText(server: string, command: string, home?: string, now = Date.now()): string {
50+ return ` This box is signed in to ${others.join(" and ")}: ${command} --server <url> uses ${others.length === 1 ? "it" : "one"}.`;
6652
Lines 88–96 at 156 (were 102–108 at 155)
105− lines.push(`This box isn't signed in to ${originOf(server)}. Run abso login.`);
92+ `This box isn't signed in to ${originOf(server)}. Run abso login.${elsewhereText(server, "abso whoami", probe.home, probe.now)}`,
Lines 143–148 at 156 (were 155–161 at 155)
158− explicit = false,
Lines 158–165 at 156 (were 171–178 at 155)
172159
174− // The folder's own server when there is one (it's the one its commands talk to), unless --server named one.
175− const target = explicit ? server : (folder?.config?.server ?? server);
161+ // Chosen as every command chooses (server-choice.ts): --server, else the folder's own, else ABSO_SERVER, else prod.
- MCP
- compare on this site's /mcp
- CLI
- abso diff 155 156 client/src/doctor.ts --json
- JSON
- /christopher/abso-core/compare/155..156?file=client%2Fsrc%2Fdoctor.ts&format=json