@sanity/ailf 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -271,18 +271,27 @@ export async function executePipeline(cliOpts) {
|
|
|
271
271
|
process.exit(1);
|
|
272
272
|
}
|
|
273
273
|
const { FileConfigAdapter } = await import("../adapters/config-sources/file-config-adapter.js");
|
|
274
|
+
const { createAppContext } = await import("../composition-root.js");
|
|
275
|
+
const callerCwd = process.env.AILF_CALLER_CWD ?? process.cwd();
|
|
274
276
|
const adapter = new FileConfigAdapter(cliOpts.config, ROOT);
|
|
275
277
|
const config = await adapter.resolve();
|
|
276
|
-
|
|
277
|
-
//
|
|
278
|
-
//
|
|
279
|
-
//
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
278
|
+
// Merge CLI-only flags that aren't in the config file.
|
|
279
|
+
// The file config (from the API payload) has taskSourceType and other
|
|
280
|
+
// pipeline options, but CLI-only args like --repo-tasks-path and
|
|
281
|
+
// --output are only available from the command line.
|
|
282
|
+
if (cliOpts.repoTasksPath) {
|
|
283
|
+
config.repoTasksPath = resolve(callerCwd, cliOpts.repoTasksPath);
|
|
284
|
+
}
|
|
285
|
+
if (cliOpts.output) {
|
|
286
|
+
config.outputPath = resolve(callerCwd, cliOpts.output);
|
|
287
|
+
}
|
|
288
|
+
// Create AppContext directly from the merged config so adapters
|
|
289
|
+
// (especially taskSource) are wired from the file config's
|
|
290
|
+
// taskSourceType — not from CLI defaults.
|
|
291
|
+
const ctx = createAppContext(config);
|
|
283
292
|
const pipelineStart = Date.now();
|
|
284
|
-
const steps = buildStepSequence(
|
|
285
|
-
const result = await orchestratePipeline(
|
|
293
|
+
const steps = buildStepSequence(ctx, pipelineStart);
|
|
294
|
+
const result = await orchestratePipeline(ctx, steps);
|
|
286
295
|
writePipelineResult(result);
|
|
287
296
|
process.exit(result.success ? 0 : 1);
|
|
288
297
|
}
|