Update documentation and handling to use a crates/collab/seed.json
(#10874)
Updates `collab` to accept a `seed.json` file that allows you to override the defaults. Updated the `README` in collab to just have directions inside instead of redirecting the developer to the website. Release Notes: - N/A Co-authored-by: Max <max@zed.dev>
This commit is contained in:
parent
ae3c641bbe
commit
efcd31c254
3 changed files with 52 additions and 5 deletions
|
@ -20,9 +20,20 @@ OPTIONS
|
|||
const { spawn, execFileSync } = require("child_process");
|
||||
const assert = require("assert");
|
||||
|
||||
const users = require(
|
||||
process.env.SEED_PATH || "../crates/collab/seed.default.json",
|
||||
).admins;
|
||||
let users;
|
||||
if (process.env.SEED_PATH) {
|
||||
users = require(process.env.SEED_PATH).admins;
|
||||
} else {
|
||||
users = require("../crates/collab/seed.default.json").admins;
|
||||
try {
|
||||
const defaultUsers = users;
|
||||
const customUsers = require("../crates/collab/seed.json").admins;
|
||||
assert(customUsers.length > 0);
|
||||
users = customUsers.concat(
|
||||
defaultUsers.filter((user) => !customUsers.includes(user)),
|
||||
);
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
const RESOLUTION_REGEX = /(\d+) x (\d+)/;
|
||||
const DIGIT_FLAG_REGEX = /^--?(\d+)$/;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue