29 lines
740 B
TypeScript
29 lines
740 B
TypeScript
#!/usr/bin/env npx tsx
|
|
/**
|
|
* scripts/set-operator.ts — operator-facing wrapper around the shared
|
|
* operator-auth setup flow.
|
|
*
|
|
* Usage:
|
|
* npm run set-operator -- <email>
|
|
*/
|
|
|
|
import { run as runOperatorAuth } from '../setup/operator-auth.js';
|
|
|
|
function fail(message: string, code = 1): never {
|
|
process.stderr.write(`set-operator: ${message}\n`);
|
|
process.exit(code);
|
|
}
|
|
|
|
async function main(): Promise<void> {
|
|
const email = process.argv[2]?.trim();
|
|
if (!email) {
|
|
fail('missing email argument. Usage: npm run set-operator -- <email>', 2);
|
|
}
|
|
|
|
await runOperatorAuth(['--email', email]);
|
|
}
|
|
|
|
main().catch((error: unknown) => {
|
|
const message = error instanceof Error ? error.message : String(error);
|
|
fail(message);
|
|
});
|