hub-runner 0.2.1 → 0.2.2
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/bin/hub-runner.mjs +8 -2
- package/check.mjs +1336 -0
- package/main.mjs +2 -0
- package/package.json +3 -2
package/bin/hub-runner.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { kickstart, loaded, start, stop } from '../lib/launchd.mjs';
|
|
|
8
8
|
import { login } from '../lib/login.mjs';
|
|
9
9
|
import { alive, live, read, statuses, stillRunning } from '../lib/state.mjs';
|
|
10
10
|
|
|
11
|
-
const USAGE = `hub-runner login | start [--take-over] | stop | restart | status | logs [-f] | logout
|
|
11
|
+
const USAGE = `hub-runner login | start [--take-over] | stop | restart | status | logs [-f] | logout | check [workspace]
|
|
12
12
|
|
|
13
13
|
login sign in with Vercel and choose the workspace this Mac runs bots for
|
|
14
14
|
start start the runner under launchd (it starts again at every login); --take-over claims it from another Mac
|
|
@@ -16,7 +16,8 @@ const USAGE = `hub-runner login | start [--take-over] | stop | restart | status
|
|
|
16
16
|
restart let the open turns finish, then start the runner again (after \`npm i -g hub-runner@latest --min-release-age=0\`)
|
|
17
17
|
status what the runner is doing; exits 1 when it isn't running
|
|
18
18
|
logs the runner's log; -f follows it
|
|
19
|
-
logout stop the runner and forget the sign-in
|
|
19
|
+
logout stop the runner and forget the sign-in
|
|
20
|
+
check stage a workspace checkout's Mac bots as the runner does, start each and have it answer one message (CI: exits 1 on any failure)`;
|
|
20
21
|
|
|
21
22
|
/** SIGUSR2 drains the runner (open turns finish, nothing new starts) and it exits 6; then launchd starts it again.
|
|
22
23
|
* The signal, the wait and the kickstart all run in a detached process: run from a bot the runner hosts, this CLI is
|
|
@@ -66,6 +67,11 @@ try {
|
|
|
66
67
|
case 'status': status(); break;
|
|
67
68
|
case 'logs': logs(args.includes('-f')); break;
|
|
68
69
|
case 'logout': stop(); rmSync(credentialsFile(), { force: true }); break;
|
|
70
|
+
case 'check': {
|
|
71
|
+
const { checkLocalBots } = await import('../check.mjs');
|
|
72
|
+
for (const { bot, reply } of await checkLocalBots(args[0] ?? process.cwd())) console.log(`${bot}: ${reply}`);
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
69
75
|
default: console.error(USAGE); process.exitCode = command ? 2 : 0;
|
|
70
76
|
}
|
|
71
77
|
} catch (e) {
|