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:
Kyle Kelley 2024-04-23 05:41:31 -07:00 committed by GitHub
parent ae3c641bbe
commit efcd31c254
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 52 additions and 5 deletions

View file

@ -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+)$/;