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)
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ ! -f .gitmodules ]; then
|
||||
echo "No .gitmodules found; skipping submodule update."
|
||||
exit 0
|
||||
fi
|
||||
git submodule sync --recursive
|
||||
for attempt in 1 2 3 4 5; do
|
||||
if git -c protocol.version=2 submodule update --init --force --depth=1 --recursive; then
|
||||
@ -101,6 +105,10 @@ jobs:
|
||||
- name: Checkout submodules (retry)
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ ! -f .gitmodules ]; then
|
||||
echo "No .gitmodules found; skipping submodule update."
|
||||
exit 0
|
||||
fi
|
||||
git submodule sync --recursive
|
||||
for attempt in 1 2 3 4 5; do
|
||||
if git -c protocol.version=2 submodule update --init --force --depth=1 --recursive; then
|
||||
@ -217,6 +225,10 @@ jobs:
|
||||
- name: Checkout submodules (retry)
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ ! -f .gitmodules ]; then
|
||||
echo "No .gitmodules found; skipping submodule update."
|
||||
exit 0
|
||||
fi
|
||||
git submodule sync --recursive
|
||||
for attempt in 1 2 3 4 5; do
|
||||
if git -c protocol.version=2 submodule update --init --force --depth=1 --recursive; then
|
||||
@ -293,6 +305,10 @@ jobs:
|
||||
- name: Checkout submodules (retry)
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ ! -f .gitmodules ]; then
|
||||
echo "No .gitmodules found; skipping submodule update."
|
||||
exit 0
|
||||
fi
|
||||
git submodule sync --recursive
|
||||
for attempt in 1 2 3 4 5; do
|
||||
if git -c protocol.version=2 submodule update --init --force --depth=1 --recursive; then
|
||||
@ -389,6 +405,10 @@ jobs:
|
||||
- name: Checkout submodules (retry)
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ ! -f .gitmodules ]; then
|
||||
echo "No .gitmodules found; skipping submodule update."
|
||||
exit 0
|
||||
fi
|
||||
git submodule sync --recursive
|
||||
for attempt in 1 2 3 4 5; do
|
||||
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",
|
||||
"restart",
|
||||
]);
|
||||
|
||||
const CLIENT_MODE_COMMANDS = new Set(["tui"]);
|
||||
let didRunDoctorConfigFlow = false;
|
||||
|
||||
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: {
|
||||
runtime: RuntimeEnv;
|
||||
commandPath?: string[];
|
||||
rawArgs?: string[];
|
||||
}): Promise<void> {
|
||||
if (!didRunDoctorConfigFlow) {
|
||||
didRunDoctorConfigFlow = true;
|
||||
@ -39,8 +42,13 @@ export async function ensureConfigReady(params: {
|
||||
const snapshot = await readConfigFileSnapshot();
|
||||
const commandName = params.commandPath?.[0];
|
||||
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
|
||||
? ALLOWED_INVALID_COMMANDS.has(commandName) ||
|
||||
isClientModeCommand ||
|
||||
(commandName === "gateway" &&
|
||||
subcommandName &&
|
||||
ALLOWED_INVALID_GATEWAY_SUBCOMMANDS.has(subcommandName))
|
||||
|
||||
@ -41,7 +41,7 @@ export function registerPreActionHooks(program: Command, programVersion: string)
|
||||
process.env.NODE_NO_WARNINGS ??= "1";
|
||||
}
|
||||
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
|
||||
if (PLUGIN_REQUIRED_COMMANDS.has(commandPath[0])) {
|
||||
ensurePluginRegistryLoaded();
|
||||
|
||||
@ -13,7 +13,11 @@ async function prepareRoutedCommand(params: {
|
||||
loadPlugins?: boolean;
|
||||
}) {
|
||||
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) {
|
||||
ensurePluginRegistryLoaded();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user