Diffinery

codician/diffinerypublic

Open-source, agent-first GitHub and GitHub Actions alternative that runs on your own Cloudflare account: git hosting, pull requests, code review and drop-in GitHub Actions YAML on Workers, Durable Objects, R2 and Containers.

Agent setup script: keep the installer's advice for people out of an agent's setup log (#255)

* Agent setup script: keep the installer's advice for people out of an agent's setup log
test-bot authored 1 parent 7209c91commit 1d10bcf54df8a53b04114256cd7ce04be30cf401Browse files
2 files changed+8−1
modifiedapps/cli/install/agent-setup.sh+6−1View file
@@ -58,7 +58,12 @@
5858 no_rc=${DIFFINERY_NO_MODIFY_PATH:-}
5959 if [ -d "$link_dir" ] && [ -w "$link_dir" ]; then no_rc=1; fi
6060 installer=$(curl -fsSL "$server/install") || fail "couldn't download $server/install: allow $host in the environment's network settings (Custom with $host, or Full)"
61- printf '%s\n' "$installer" | DIFFINERY_URL=$server DIFFINERY_INSTALL=$root DIFFINERY_NO_MODIFY_PATH=$no_rc bash || fail "the diffinery CLI didn't install (see above)"
61+ # The installer's own next steps (sign in through a browser, PATH) are for people: shown only if it fails.
62+ if ! out=$(printf '%s\n' "$installer" | DIFFINERY_URL=$server DIFFINERY_INSTALL=$root DIFFINERY_NO_MODIFY_PATH=$no_rc bash 2>&1); then
63+ printf '%s\n' "$out"
64+ fail "the diffinery CLI didn't install (see above)"
65+ fi
66+ say "${green}✓${reset} diffinery CLI: installed $("$root/bin/diffinery" --version 2>/dev/null)"
6267 fi
6368 if [ -d "$link_dir" ] && [ -w "$link_dir" ]; then
6469 ln -sfn "$root/bin/diffinery" "$link_dir/diffinery" || fail "couldn't link $link_dir/diffinery"
modifiedapps/diffinery/test/e2e/agent-setup.test.mjs+2−0View file
@@ -288,6 +288,8 @@
288288 const first = await runSetup(m, env);
289289 assert.equal(first.code, 0, first.out);
290290 assert.ok(!first.out.includes(token), "never prints the token");
291+ assert.match(first.out, /✓ diffinery CLI: installed diffinery \d/);
292+ assert.ok(!first.out.includes("sign in through your browser"), "no advice meant for people");
291293 for (const s of ["✓ server:", "✓ diffinery on PATH:", "✓ DIFFINERY_TOKEN: acts as zutrix-agent (agent)", "✓ repository: ada/zutrix with write access", "✓ git:", "✓ clone: cloned into", "✓ gh: gh api acts as zutrix-agent", "✓ gh in the clone:", "Ready:"]) assert.ok(first.out.includes(s), `${s}\n${first.out}`);
292294 const all = { ...m.env, ...env };
293295 // The acceptance checks, as the session would run them: no path prefix, no prompt.