Merge e80080fc1c into 09be5d45d5
This commit is contained in:
commit
21f1ea00d9
20
.github/workflows/ci.yml
vendored
20
.github/workflows/ci.yml
vendored
@ -16,6 +16,10 @@ jobs:
|
|||||||
- name: Checkout submodules (retry)
|
- name: Checkout submodules (retry)
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
if [ ! -f .gitmodules ]; then
|
||||||
|
echo "No .gitmodules found; skipping submodule update."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
git submodule sync --recursive
|
git submodule sync --recursive
|
||||||
for attempt in 1 2 3 4 5; do
|
for attempt in 1 2 3 4 5; do
|
||||||
if git -c protocol.version=2 submodule update --init --force --depth=1 --recursive; then
|
if git -c protocol.version=2 submodule update --init --force --depth=1 --recursive; then
|
||||||
@ -101,6 +105,10 @@ jobs:
|
|||||||
- name: Checkout submodules (retry)
|
- name: Checkout submodules (retry)
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
if [ ! -f .gitmodules ]; then
|
||||||
|
echo "No .gitmodules found; skipping submodule update."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
git submodule sync --recursive
|
git submodule sync --recursive
|
||||||
for attempt in 1 2 3 4 5; do
|
for attempt in 1 2 3 4 5; do
|
||||||
if git -c protocol.version=2 submodule update --init --force --depth=1 --recursive; then
|
if git -c protocol.version=2 submodule update --init --force --depth=1 --recursive; then
|
||||||
@ -217,6 +225,10 @@ jobs:
|
|||||||
- name: Checkout submodules (retry)
|
- name: Checkout submodules (retry)
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
if [ ! -f .gitmodules ]; then
|
||||||
|
echo "No .gitmodules found; skipping submodule update."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
git submodule sync --recursive
|
git submodule sync --recursive
|
||||||
for attempt in 1 2 3 4 5; do
|
for attempt in 1 2 3 4 5; do
|
||||||
if git -c protocol.version=2 submodule update --init --force --depth=1 --recursive; then
|
if git -c protocol.version=2 submodule update --init --force --depth=1 --recursive; then
|
||||||
@ -293,6 +305,10 @@ jobs:
|
|||||||
- name: Checkout submodules (retry)
|
- name: Checkout submodules (retry)
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
if [ ! -f .gitmodules ]; then
|
||||||
|
echo "No .gitmodules found; skipping submodule update."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
git submodule sync --recursive
|
git submodule sync --recursive
|
||||||
for attempt in 1 2 3 4 5; do
|
for attempt in 1 2 3 4 5; do
|
||||||
if git -c protocol.version=2 submodule update --init --force --depth=1 --recursive; then
|
if git -c protocol.version=2 submodule update --init --force --depth=1 --recursive; then
|
||||||
@ -389,6 +405,10 @@ jobs:
|
|||||||
- name: Checkout submodules (retry)
|
- name: Checkout submodules (retry)
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
if [ ! -f .gitmodules ]; then
|
||||||
|
echo "No .gitmodules found; skipping submodule update."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
git submodule sync --recursive
|
git submodule sync --recursive
|
||||||
for attempt in 1 2 3 4 5; do
|
for attempt in 1 2 3 4 5; do
|
||||||
if git -c protocol.version=2 submodule update --init --force --depth=1 --recursive; then
|
if git -c protocol.version=2 submodule update --init --force --depth=1 --recursive; then
|
||||||
|
|||||||
@ -18,6 +18,8 @@ const ALLOWED_INVALID_GATEWAY_SUBCOMMANDS = new Set([
|
|||||||
"stop",
|
"stop",
|
||||||
"restart",
|
"restart",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const CLIENT_MODE_COMMANDS = new Set(["tui"]);
|
||||||
let didRunDoctorConfigFlow = false;
|
let didRunDoctorConfigFlow = false;
|
||||||
|
|
||||||
function formatConfigIssues(issues: Array<{ path: string; message: string }>): string[] {
|
function formatConfigIssues(issues: Array<{ path: string; message: string }>): string[] {
|
||||||
@ -27,6 +29,7 @@ function formatConfigIssues(issues: Array<{ path: string; message: string }>): s
|
|||||||
export async function ensureConfigReady(params: {
|
export async function ensureConfigReady(params: {
|
||||||
runtime: RuntimeEnv;
|
runtime: RuntimeEnv;
|
||||||
commandPath?: string[];
|
commandPath?: string[];
|
||||||
|
rawArgs?: string[];
|
||||||
}): Promise<void> {
|
}): Promise<void> {
|
||||||
if (!didRunDoctorConfigFlow) {
|
if (!didRunDoctorConfigFlow) {
|
||||||
didRunDoctorConfigFlow = true;
|
didRunDoctorConfigFlow = true;
|
||||||
@ -39,8 +42,13 @@ export async function ensureConfigReady(params: {
|
|||||||
const snapshot = await readConfigFileSnapshot();
|
const snapshot = await readConfigFileSnapshot();
|
||||||
const commandName = params.commandPath?.[0];
|
const commandName = params.commandPath?.[0];
|
||||||
const subcommandName = params.commandPath?.[1];
|
const subcommandName = params.commandPath?.[1];
|
||||||
|
|
||||||
|
const hasUrlFlag = params.rawArgs?.some((arg) => arg === "--url" || arg.startsWith("--url="));
|
||||||
|
const isClientModeCommand = commandName && CLIENT_MODE_COMMANDS.has(commandName) && hasUrlFlag;
|
||||||
|
|
||||||
const allowInvalid = commandName
|
const allowInvalid = commandName
|
||||||
? ALLOWED_INVALID_COMMANDS.has(commandName) ||
|
? ALLOWED_INVALID_COMMANDS.has(commandName) ||
|
||||||
|
isClientModeCommand ||
|
||||||
(commandName === "gateway" &&
|
(commandName === "gateway" &&
|
||||||
subcommandName &&
|
subcommandName &&
|
||||||
ALLOWED_INVALID_GATEWAY_SUBCOMMANDS.has(subcommandName))
|
ALLOWED_INVALID_GATEWAY_SUBCOMMANDS.has(subcommandName))
|
||||||
|
|||||||
@ -41,7 +41,7 @@ export function registerPreActionHooks(program: Command, programVersion: string)
|
|||||||
process.env.NODE_NO_WARNINGS ??= "1";
|
process.env.NODE_NO_WARNINGS ??= "1";
|
||||||
}
|
}
|
||||||
if (commandPath[0] === "doctor") return;
|
if (commandPath[0] === "doctor") return;
|
||||||
await ensureConfigReady({ runtime: defaultRuntime, commandPath });
|
await ensureConfigReady({ runtime: defaultRuntime, commandPath, rawArgs: argv });
|
||||||
// Load plugins for commands that need channel access
|
// Load plugins for commands that need channel access
|
||||||
if (PLUGIN_REQUIRED_COMMANDS.has(commandPath[0])) {
|
if (PLUGIN_REQUIRED_COMMANDS.has(commandPath[0])) {
|
||||||
ensurePluginRegistryLoaded();
|
ensurePluginRegistryLoaded();
|
||||||
|
|||||||
@ -13,7 +13,11 @@ async function prepareRoutedCommand(params: {
|
|||||||
loadPlugins?: boolean;
|
loadPlugins?: boolean;
|
||||||
}) {
|
}) {
|
||||||
emitCliBanner(VERSION, { argv: params.argv });
|
emitCliBanner(VERSION, { argv: params.argv });
|
||||||
await ensureConfigReady({ runtime: defaultRuntime, commandPath: params.commandPath });
|
await ensureConfigReady({
|
||||||
|
runtime: defaultRuntime,
|
||||||
|
commandPath: params.commandPath,
|
||||||
|
rawArgs: params.argv,
|
||||||
|
});
|
||||||
if (params.loadPlugins) {
|
if (params.loadPlugins) {
|
||||||
ensurePluginRegistryLoaded();
|
ensurePluginRegistryLoaded();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user