test(codex): support direct SessionStart hooks in #2698 helper
This commit is contained in:
@@ -102,11 +102,12 @@ function writeCodexConfigWithStaleHooks(dir, headerEol, bodyEol) {
|
|||||||
? parsed.hooks
|
? parsed.hooks
|
||||||
: parsed;
|
: parsed;
|
||||||
const sessionStart = Array.isArray(table.SessionStart) ? table.SessionStart : [];
|
const sessionStart = Array.isArray(table.SessionStart) ? table.SessionStart : [];
|
||||||
return sessionStart.flatMap((entry) =>
|
return sessionStart.flatMap((entry) => [
|
||||||
(Array.isArray(entry?.hooks) ? entry.hooks : [])
|
...(typeof entry?.command === 'string' ? [entry.command] : []),
|
||||||
.map((hook) => hook && hook.command)
|
...(Array.isArray(entry?.hooks)
|
||||||
.filter((cmd) => typeof cmd === 'string')
|
? entry.hooks.map((hook) => hook && hook.command).filter((cmd) => typeof cmd === 'string')
|
||||||
);
|
: []),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
test('LF config.toml: stale gsd-update-check block removed on reinstall', (t) => {
|
test('LF config.toml: stale gsd-update-check block removed on reinstall', (t) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user