From 74b60c00d7c5918e017047fc862106ffc49f877f Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Thu, 1 Aug 2024 16:42:54 -0600 Subject: [PATCH] resolves #29 replace $NODE token (not node) at start of command with Node.js exec path --- CHANGELOG.adoc | 5 + README.adoc | 2 +- .../ROOT/pages/configuration-keys.adoc | 5 +- packages/collector-extension/lib/index.js | 37 +++--- .../test/collector-extension-test.js | 121 +++++++++--------- 5 files changed, 90 insertions(+), 80 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 4a930bb..615643c 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -13,6 +13,11 @@ For a detailed view of what's changed, refer to the {url-repo}/commits[commit hi * add `env` key to run entry to set (or unset) environment variables for the run command (#24) * add support for referencing context variables in the value of an `env` entry (#24) * allow context variables to be referenced in command (#26) +* replace $NODE token at start of command with Node.js exec path (#29) + +=== Changed + +* do not rewrite `node` argument at start of command (#29) == 1.0.0-alpha.7 (2024-07-24) diff --git a/README.adoc b/README.adoc index 37a7727..f70adec 100644 --- a/README.adoc +++ b/README.adoc @@ -92,7 +92,7 @@ version: true ext: collector: run: - command: node generate-files.js + command: $NODE generate-files.js scan: dir: build/generated-files ---- diff --git a/docs/modules/ROOT/pages/configuration-keys.adoc b/docs/modules/ROOT/pages/configuration-keys.adoc index 92798d5..81c0028 100644 --- a/docs/modules/ROOT/pages/configuration-keys.adoc +++ b/docs/modules/ROOT/pages/configuration-keys.adoc @@ -189,6 +189,9 @@ run: command: command-to-run --config-dir ${{env.HOME}}/.config/config-for-command ---- +If the command begins with `$NODE` (or `${{env.NODE}}`) followed by a space, that token will be replaced with the value of the `NODE` environment variable set on the Antora process, which defaults to the path of the Node.js executable used to run Antora. +Similarly, if the command begins with the path of a JavaScript file, the value of the `NODE` environment variable is inserted as the first command argument. + If the `local` key is specified with the value `true`, the command must be located relative to where the command is run. This key can be set implicitly by prepending the command with `./`. This setting effectively disables looking for a global command on the current user's PATH. @@ -243,7 +246,7 @@ version: '5.6.0' ext: collector: run: - command: node generate-files.js + command: $NODE generate-files.js env: - name: ANTORA_COLLECTOR value: '1' diff --git a/packages/collector-extension/lib/index.js b/packages/collector-extension/lib/index.js index 04cc105..551aa16 100644 --- a/packages/collector-extension/lib/index.js +++ b/packages/collector-extension/lib/index.js @@ -24,6 +24,7 @@ const CONTEXT_VARIABLE_REF_RX = /\$\{\{ *([a-z0-9_.]+)(?: as (json|yaml))? *\}\} module.exports.register = function ({ config: { keepWorktrees = false } }) { this.once('contentAggregated', async ({ playbook, contentAggregate }) => { let logger + const playbookEnv = playbook.env const quiet = playbook.runtime?.quiet const cacheDir = ospath.join(getBaseCacheDir(playbook), 'collector') await fsp.mkdir(cacheDir, { recursive: true }) @@ -66,20 +67,10 @@ module.exports.register = function ({ config: { keepWorktrees = false } }) { if (typeof run === 'string' ? (run = { command: run }) : typeof run.command === 'string') { let command = run.command if (!command) return accum - let local = run.local || false - if (!local) { - if ((local = command.startsWith('./'))) { - command = command.slice(2) - } else if (command.startsWith('node ')) { - command = `"${process.execPath}" ${command.slice(5)}` - } else if (command.split(' ', 2)[0].endsWith('.js')) { - command = `"${process.execPath}" ${command}` - } - } const dir = typeof run.dir === 'string' ? expandPath(run.dir, expandPathContext) : worktreeDir - let env + let env = 'NODE' in playbookEnv ? playbookEnv : Object.assign({ NODE: process.execPath }, playbookEnv) let envConfig = run.env - const contextVars = { origin, playbook } + const contextVars = { origin, playbook, env } if (typeof envConfig === 'object') { if (!Array.isArray(envConfig)) { envConfig = @@ -87,16 +78,26 @@ module.exports.register = function ({ config: { keepWorktrees = false } }) { ? [envConfig] : Object.entries(envConfig).map(([name, value]) => ({ name, value })) } - contextVars.env = env = Object.assign({}, playbook.env) + if (env === playbookEnv) contextVars.env = env = Object.assign({}, env) const evaluateWithVars = evaluate.bind(null, contextVars) for (const envEntry of envConfig) { - if (!(typeof envEntry === 'object' && envEntry.name)) continue - env[envEntry.name] = evaluateWithVars(envEntry.value) - evaluateWithVars.called = true + if (typeof envEntry === 'object' && envEntry.name) { + env[envEntry.name] = evaluateWithVars(envEntry.value) + evaluateWithVars.called = true + } + } + if (!evaluateWithVars.called) env = undefined + } + let local = !!run.local + if (!local) { + if ((local = command.startsWith('./'))) { + command = command.slice(2) + } else if (command.startsWith('$NODE ')) { + command = `"${contextVars.env.NODE}" ${command.slice(6)}` + } else if (command.split(' ', 2)[0].endsWith('.js')) { + command = `"${contextVars.env.NODE}" ${command}` } - if (!evaluateWithVars.called) contextVars.env = env = undefined } - contextVars.env ??= playbook.env accum.push({ ...run, command: evaluate(contextVars, command), dir, env, local }) } return accum diff --git a/packages/collector-extension/test/collector-extension-test.js b/packages/collector-extension/test/collector-extension-test.js index fbaf568..0c9fa2c 100644 --- a/packages/collector-extension/test/collector-extension-test.js +++ b/packages/collector-extension/test/collector-extension-test.js @@ -189,7 +189,7 @@ describe('collector extension', () => { it('should run specified command in temporary worktree and collect files in scan dir', async () => { const collectorConfig = { - run: { command: 'node .gen-start-page.js' }, + run: { command: '$NODE .gen-start-page.js' }, scan: { dir: 'build' }, } await runScenario({ @@ -209,7 +209,7 @@ describe('collector extension', () => { it('should keep temporary worktree if specified', async () => { const collectorConfig = { globalConfig: { keepWorktrees: true }, - run: { command: 'node .gen-start-page.js' }, + run: { command: '$NODE .gen-start-page.js' }, scan: { dir: 'build' }, } let collectorWorktree @@ -234,7 +234,7 @@ describe('collector extension', () => { it('should keep temporary worktree until specified event', async () => { const collectorConfig = { globalConfig: { keepWorktrees: 'until:contextClosed' }, - run: { command: 'node .gen-start-page.js' }, + run: { command: '$NODE .gen-start-page.js' }, scan: { dir: 'build' }, } let collectorWorktree @@ -258,7 +258,7 @@ describe('collector extension', () => { it('should keep temporary worktree until specified event when specified on collector config', async () => { const collectorConfig = { worktree: { keep: 'until:exit' }, - run: { command: 'node .gen-start-page.js' }, + run: { command: '$NODE .gen-start-page.js' }, scan: { dir: 'build' }, } let collectorWorktree @@ -281,7 +281,7 @@ describe('collector extension', () => { it('should populate properties of file collected from temporary worktree', async () => { const collectorConfig = { - run: { command: 'node .gen-start-page.js' }, + run: { command: '$NODE .gen-start-page.js' }, scan: { dir: 'build' }, } await runScenario({ @@ -314,7 +314,7 @@ describe('collector extension', () => { it('should populate properties of file collected from start path in temporary worktree', async () => { const collectorConfig = { - run: { command: 'node .gen-docs-start-page.js' }, + run: { command: '$NODE .gen-docs-start-page.js' }, scan: { dir: 'build/docs' }, } await runScenario({ @@ -345,7 +345,7 @@ describe('collector extension', () => { it('should populate properties of file collected from local worktree', async () => { const collectorConfig = { clean: { dir: 'build' }, - run: { command: 'node .gen-start-page.js' }, + run: { command: '$NODE .gen-start-page.js' }, scan: { dir: 'build' }, } await runScenario({ @@ -378,7 +378,7 @@ describe('collector extension', () => { it('should update component metadata from antora.yml file, if found', async () => { const collectorConfig = { - run: { command: 'node .gen-component-desc.js' }, + run: { command: '$NODE .gen-component-desc.js' }, scan: { dir: 'build' }, } await runScenario({ @@ -405,7 +405,7 @@ describe('collector extension', () => { it('should remove prerelease key if not specified in scanned antora.yml file', async () => { const collectorConfig = { - run: { command: 'node .gen-component-desc.js' }, + run: { command: '$NODE .gen-component-desc.js' }, scan: { dir: 'build' }, } await runScenario({ @@ -430,7 +430,7 @@ describe('collector extension', () => { it('should inherit name and version if not specified antora.yml', async () => { const collectorConfig = { - run: { command: 'node .gen-component-desc-without-identity.js' }, + run: { command: '$NODE .gen-component-desc-without-identity.js' }, scan: { dir: 'build' }, } let bucketBefore @@ -455,7 +455,7 @@ describe('collector extension', () => { it('should only update contents of existing page', async () => { const collectorConfig = { - run: { command: 'node .gen-replace-start-page.js' }, + run: { command: '$NODE .gen-replace-start-page.js' }, scan: { dir: 'build' }, } let originalStat @@ -485,7 +485,7 @@ describe('collector extension', () => { it('should run specified command in start path of temporary worktree and collect files in scan dir', async () => { const collectorConfig = { - run: { command: 'node .gen-start-page.js', dir: '.' }, + run: { command: '$NODE .gen-start-page.js', dir: '.' }, scan: { dir: './build' }, } await runScenario({ @@ -505,7 +505,7 @@ describe('collector extension', () => { it('should run specified command from root of temporary worktree and collect files in scan dir', async () => { const collectorConfig = { - run: { command: 'node .gen-docs-start-page.js' }, + run: { command: '$NODE .gen-docs-start-page.js' }, scan: { dir: 'build/docs' }, } await runScenario({ @@ -523,7 +523,7 @@ describe('collector extension', () => { }) }) - it('should prepend node path to command identified as a JavaScript file', async () => { + it('should prepend node exec path to command identified as a JavaScript file', async () => { const collectorConfig = { run: { command: '.gen-start-page.js' }, scan: { dir: 'build' }, @@ -586,7 +586,7 @@ describe('collector extension', () => { it('should not collect files if scan key is not specified', async () => { const collectorConfig = { - run: { command: 'node .gen-start-page.js' }, + run: { command: '$NODE .gen-start-page.js' }, } await runScenario({ repoName: 'test-at-root', @@ -603,7 +603,7 @@ describe('collector extension', () => { it('should not collect files if scan dir key is not a string', async () => { const collectorConfig = { - run: { command: 'node .gen-start-page.js' }, + run: { command: '$NODE .gen-start-page.js' }, scan: {}, } await runScenario({ @@ -739,7 +739,7 @@ describe('collector extension', () => { it('should put files into existing bucket specified in antora.yml', async () => { const collectorConfig = { - run: [{ command: 'node .gen-component-desc.js create' }, { command: 'node .gen-more-files.js' }], + run: [{ command: '$NODE .gen-component-desc.js create' }, { command: '$NODE .gen-more-files.js' }], scan: { dir: 'build' }, } await runScenario({ @@ -770,7 +770,7 @@ describe('collector extension', () => { it('should put files into new bucket specified in antora.yml', async () => { const collectorConfig = { - run: [{ command: 'node .gen-component-desc.js create' }, { command: 'node .gen-more-files.js' }], + run: [{ command: '$NODE .gen-component-desc.js create' }, { command: '$NODE .gen-more-files.js' }], scan: { dir: 'build' }, } await runScenario({ @@ -795,7 +795,7 @@ describe('collector extension', () => { it('should allow bucket in antora.yml to override bucket specified on scan', async () => { const collectorConfig = { - run: [{ command: 'node .gen-component-desc.js' }, { command: 'node .gen-more-files.js' }], + run: [{ command: '$NODE .gen-component-desc.js' }, { command: '$NODE .gen-more-files.js' }], scan: { dir: 'build', into: { name: 'overridden-name', version: 'overridden-version' } }, } await runScenario({ @@ -820,7 +820,7 @@ describe('collector extension', () => { it('should collect files from multiple scan dirs', async () => { const collectorConfig = { - run: { command: 'node .gen-start-page.js', dir: '.' }, + run: { command: '$NODE .gen-start-page.js', dir: '.' }, scan: [{ dir: './build' }, { dir: 'other-docs' }], } await runScenario({ @@ -843,7 +843,7 @@ describe('collector extension', () => { it('should collect more than 16 files from single directory when scanning', async () => { const collectorConfig = { - run: { command: 'node .gen-many-files.js 20', dir: '.' }, + run: { command: '$NODE .gen-many-files.js 20', dir: '.' }, scan: { dir: './build/many-pages', files: '*.adoc', into: 'modules/ROOT/pages' }, } await runScenario({ @@ -867,11 +867,11 @@ describe('collector extension', () => { it('should process each collector entry', async () => { const collectorConfig = [ { - run: { command: 'node .gen-files.js' }, + run: { command: '$NODE .gen-files.js' }, scan: { dir: 'build' }, }, { - run: { command: 'node .gen-component-desc.js' }, + run: { command: '$NODE .gen-component-desc.js' }, scan: { dir: 'build', files: 'antora.yml' }, }, ] @@ -903,10 +903,10 @@ describe('collector extension', () => { it('should not clean worktree between collector entries', async () => { const collectorConfig = [ { - run: [{ command: 'node .gen-files.js' }, { command: 'node .gen-component-desc.js' }], + run: [{ command: '$NODE .gen-files.js' }, { command: '$NODE .gen-component-desc.js' }], }, { - run: { command: 'node .gen-start-page.js' }, + run: { command: '$NODE .gen-start-page.js' }, scan: [ { dir: 'build', files: 'antora.yml' }, { dir: 'build', files: 'modules/**/*' }, @@ -941,11 +941,11 @@ describe('collector extension', () => { it('should clean specified dirs per collector entry', async () => { const collectorConfig = [ { - run: [{ command: 'node .gen-files.js' }, { command: 'node .gen-component-desc.js' }], + run: [{ command: '$NODE .gen-files.js' }, { command: '$NODE .gen-component-desc.js' }], }, { clean: [{ dir: 'build/modules/ROOT/examples' }, { dir: 'build/modules/ROOT/partials' }], - run: { command: 'node .gen-start-page.js' }, + run: { command: '$NODE .gen-start-page.js' }, scan: [ { dir: 'build', files: 'antora.yml' }, { dir: 'build', files: 'modules/**/*' }, @@ -1003,7 +1003,7 @@ describe('collector extension', () => { it('should only collect files that match the scan pattern', async () => { const collectorConfig = { - run: { command: 'node .gen-files.js' }, + run: { command: '$NODE .gen-files.js' }, scan: { dir: 'build', files: '**/*.adoc' }, } await runScenario({ @@ -1023,7 +1023,7 @@ describe('collector extension', () => { it('should support an array of scan patterns with inclusions and exclusions', async () => { const collectorConfig = { - run: { command: 'node .gen-files.js' }, + run: { command: '$NODE .gen-files.js' }, scan: { dir: 'build', files: ['**/*.adoc', '!modules/*/partials/**/*.adoc', 'modules/**/*.rb'] }, } await runScenario({ @@ -1044,9 +1044,9 @@ describe('collector extension', () => { it('should set specified environment variables for run operation', async () => { const collectorConfig = { run: [ - { command: 'node .gen-component-desc.js' }, + { command: '$NODE .gen-component-desc.js' }, { - command: 'node .gen-using-env.js', + command: '$NODE .gen-using-env.js', env: [ { name: 'ANTORA_COLLECTOR_ORIGIN', @@ -1092,9 +1092,9 @@ describe('collector extension', () => { it('should handle non-string environment variable values', async () => { const collectorConfig = { run: [ - { command: 'node .gen-component-desc.js' }, + { command: '$NODE .gen-component-desc.js' }, { - command: 'node .gen-using-env.js', + command: '$NODE .gen-using-env.js', env: [ { name: 'USER', value: null }, { name: 'ENV_VALUE_AS_STRING', value: 99.9 }, @@ -1124,9 +1124,9 @@ describe('collector extension', () => { it('should allow value of env key on run to be expressed as an object', async () => { const collectorConfig = { run: [ - { command: 'node .gen-component-desc.js' }, + { command: '$NODE .gen-component-desc.js' }, { - command: 'node .gen-using-env.js', + command: '$NODE .gen-using-env.js', env: { name: 'ANTORA_COLLECTOR_ORIGIN', value: '$' + '{{origin as json}}' }, }, ], @@ -1151,9 +1151,9 @@ describe('collector extension', () => { it('should allow value of env key on run to be a map', async () => { const collectorConfig = { run: [ - { command: 'node .gen-component-desc.js' }, + { command: '$NODE .gen-component-desc.js' }, { - command: 'node .gen-using-env.js', + command: '$NODE .gen-using-env.js', env: { refname: '$' + '{{origin.refname}}' }, }, ], @@ -1200,7 +1200,7 @@ describe('collector extension', () => { it('should allow context variables to be referenced in command', async () => { const collectorConfig = { run: { - command: 'node .gen-many-files.js $' + '{{env.NUM_FILES}}', + command: '$NODE .gen-many-files.js $' + '{{env.NUM_FILES}}', dir: '.', env: [{ name: 'NUM_FILES', value: '5' }], }, @@ -1227,7 +1227,7 @@ describe('collector extension', () => { it('should create cache folder under user cache if cache dir is not specified', async () => { const collectorConfig = { - run: { command: 'node .gen-start-page.js' }, + run: { command: '$NODE .gen-start-page.js' }, scan: { dir: 'build' }, } await runScenario({ @@ -1250,7 +1250,7 @@ describe('collector extension', () => { it('should reuse worktree without cleaning if no clean step is specified', async () => { const collectorConfig = { - run: { command: 'node .gen-start-page.js' }, + run: { command: '$NODE .gen-start-page.js' }, scan: { dir: 'build' }, } await runScenario({ @@ -1277,7 +1277,7 @@ describe('collector extension', () => { it('should clean scan dir in worktree before running command(s) if clean key on scan entry is true', async () => { const collectorConfig = { - run: { command: 'node .gen-start-page.js' }, + run: { command: '$NODE .gen-start-page.js' }, scan: { clean: true, dir: 'build' }, } await runScenario({ @@ -1301,7 +1301,7 @@ describe('collector extension', () => { it('should run specified command in temporary worktree if repository is local and reference is not worktree', async () => { const collectorConfig = { clean: { dir: 'build' }, - run: { command: 'node .gen-start-page.js' }, + run: { command: '$NODE .gen-start-page.js' }, scan: { dir: 'build' }, } await runScenario({ @@ -1324,7 +1324,7 @@ describe('collector extension', () => { it('should run specified command in each branch that defines collector config', async () => { const collectorConfig = { clean: { dir: 'build' }, - run: { command: 'node .gen-start-page.js' }, + run: { command: '$NODE .gen-start-page.js' }, scan: { dir: 'build' }, } await runScenario({ @@ -1352,7 +1352,7 @@ describe('collector extension', () => { it('should run specified command in branch that defines collector config when branch name contains segments', async () => { const collectorConfig = { - run: { command: 'node .gen-component-desc-for-ref.js' }, + run: { command: '$NODE .gen-component-desc-for-ref.js' }, scan: { dir: 'build' }, } await runScenario({ @@ -1375,7 +1375,7 @@ describe('collector extension', () => { it('should run specified command in tag that defines collector config', async () => { const collectorConfig = { - run: { command: 'node .gen-for-tag.js' }, + run: { command: '$NODE .gen-for-tag.js' }, scan: { dir: 'build' }, } await runScenario({ @@ -1403,7 +1403,7 @@ describe('collector extension', () => { it('should run command inside worktree for both branches and tags in same repository', async () => { const collectorConfig = { - run: { command: 'node .gen-component-desc-for-ref.js' }, + run: { command: '$NODE .gen-component-desc-for-ref.js' }, scan: { dir: 'build' }, } await runScenario({ @@ -1430,7 +1430,7 @@ describe('collector extension', () => { it('should not modify index of local repository when checking out ref to worktree', async () => { const collectorConfig = { clean: { dir: 'build' }, - run: { command: 'node .gen-start-page.js' }, + run: { command: '$NODE .gen-start-page.js' }, scan: { dir: 'build' }, } let expectedIndex @@ -1452,7 +1452,7 @@ describe('collector extension', () => { it('should remove invalid temporary worktree left behind by previous run', async () => { const collectorConfig = { - run: { command: 'node .gen-component-desc.js' }, + run: { command: '$NODE .gen-component-desc.js' }, scan: { dir: 'build' }, } await runScenario({ @@ -1479,7 +1479,7 @@ describe('collector extension', () => { it('should not leave behind index file in managed repository', async () => { const collectorConfig = { - run: { command: 'node .check-index-file.js' }, + run: { command: '$NODE .check-index-file.js' }, scan: { dir: 'build' }, } await runScenario({ @@ -1497,7 +1497,7 @@ describe('collector extension', () => { it('should remove untracked changes when switching worktrees for same repository', async () => { const collectorConfig = { - run: { command: 'node .gen-dirty-worktree.js' }, + run: { command: '$NODE .gen-dirty-worktree.js' }, scan: { dir: 'build' }, } await runScenario({ @@ -1525,7 +1525,7 @@ describe('collector extension', () => { it('should not follow symlinks when removing untracked files in worktree', async () => { const collectorConfig = { - run: { command: 'node .check-dirty-worktree.js' }, + run: { command: '$NODE .check-dirty-worktree.js' }, scan: { dir: 'build' }, } await runScenario({ @@ -1547,7 +1547,7 @@ describe('collector extension', () => { it('should force checkout if worktree has changes when switching worktrees for same repository', async () => { const collectorConfig = { - run: { command: 'node .gen-dirty-worktree.js delete' }, + run: { command: '$NODE .gen-dirty-worktree.js delete' }, scan: { dir: 'build' }, } await runScenario({ @@ -1615,7 +1615,7 @@ describe('collector extension', () => { }) it('should send output from command to stdout by default', async () => { - const collectorConfig = { run: { command: 'node .gen-output.js' } } + const collectorConfig = { run: { command: '$NODE .gen-output.js' } } const stdout = await captureStdout(() => runScenario({ repoName: 'test-at-root', @@ -1630,7 +1630,7 @@ describe('collector extension', () => { // TODO: perhaps direct these messages to the log? it('should always direct stderr output of command to stderr', async () => { - const collectorConfig = { run: { command: 'node .gen-error-output.js' } } + const collectorConfig = { run: { command: '$NODE .gen-error-output.js' } } const stderr = await captureStderr(() => runScenario({ repoName: 'test-at-root', collectorConfig })) expect(stderr).to.equal('there were some issues\n') }) @@ -1638,7 +1638,7 @@ describe('collector extension', () => { if (!windows) { // FIXME reenable on Windows it('should escape quoted string inside quoted string in command', async () => { - const collectorConfig = { run: { command: 'node -p \'"start\\nall done!"\'' } } + const collectorConfig = { run: { command: '$NODE -p \'"start\\nall done!"\'' } } const stdout = await captureStdout(() => runScenario({ repoName: 'test-at-root', @@ -1653,7 +1653,7 @@ describe('collector extension', () => { } it('should not send output from command to stdout by default if quiet is set', async () => { - const collectorConfig = { run: { command: 'node .gen-output.js' } } + const collectorConfig = { run: { command: '$NODE .gen-output.js' } } const stdout = await captureStdout(() => runScenario({ repoName: 'test-at-root', collectorConfig })) expect(stdout).to.be.empty() }) @@ -1694,7 +1694,7 @@ describe('collector extension', () => { // also verifies that node command is replaced with process.execPath it('should throw error if command fails to complete successfully', async () => { - const collectorConfig = { run: { command: 'node .gen-failure.js' } } + const collectorConfig = { run: { command: '$NODE .gen-failure.js' } } const expectedMessage = '(@antora/collector-extension): Command failed with exit code 1: ' + (windows ? '' : `${process.execPath} .gen-failure.js in `) @@ -1755,7 +1755,7 @@ describe('collector extension', () => { repoName: 'test-at-root-1', fixture: 'test-at-root', collectorConfig: { - run: { command: 'node .gen-start-page.js' }, + run: { command: '$NODE .gen-start-page.js' }, scan: { dir: 'build' }, }, }) @@ -1764,12 +1764,11 @@ describe('collector extension', () => { repoName: 'test-at-root-3', fixture: 'test-at-root', collectorConfig: { - run: { command: 'node .gen-more-files.js' }, + run: { command: '$NODE .gen-more-files.js' }, scan: { dir: 'build' }, }, }) const playbook = { - runtime: { cacheDir: CACHE_DIR, quiet: true }, content: { sources: [ { url: repo1.url, branches: 'main' }, @@ -1777,6 +1776,8 @@ describe('collector extension', () => { { url: repo3.url, branches: 'main' }, ], }, + runtime: { cacheDir: CACHE_DIR, quiet: true }, + env: process.env, } const contentAggregate = await aggregateContent(playbook) const generatorContext = createGeneratorContext() -- GitLab