@openthink/stamp 1.5.1 → 1.5.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/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5536,8 +5536,16 @@ function runUsersList(opts) {
|
|
|
5536
5536
|
);
|
|
5537
5537
|
}
|
|
5538
5538
|
const rows = payload.users ?? [];
|
|
5539
|
+
const warning = ownerlessWarning(rows);
|
|
5540
|
+
if (warning) process.stderr.write(warning);
|
|
5539
5541
|
process.stdout.write(formatUsersTable(rows));
|
|
5540
5542
|
}
|
|
5543
|
+
function ownerlessWarning(rows) {
|
|
5544
|
+
if (rows.length === 0) return null;
|
|
5545
|
+
const hasOwner = rows.some((r) => r.role === "owner");
|
|
5546
|
+
if (hasOwner) return null;
|
|
5547
|
+
return "warning: this stamp server has NO OWNER configured.\nwarning: an admin can self-promote to owner ONCE, but only while no\nwarning: owner exists \u2014 and any admin (yours or someone else's) can\nwarning: race to claim it. Until you do, the server can't promote\nwarning: anyone to admin or appoint other owners.\nwarning:\nwarning: claim ownership now from THIS machine before anyone beats you:\nwarning: stamp users promote <your-short-name> --to owner\nwarning:\n";
|
|
5548
|
+
}
|
|
5541
5549
|
function runUsersPromote(opts) {
|
|
5542
5550
|
const server2 = resolveServer3();
|
|
5543
5551
|
const result = callRemote(server2, [
|