Skip to content

Commit b113192

Browse files
committed
fix(plugin-lighthouse): prevent cleanup permissions error on windows
1 parent c511865 commit b113192

File tree

1 file changed

+7
-1
lines changed
  • packages/plugin-lighthouse/src/lib/runner

1 file changed

+7
-1
lines changed

packages/plugin-lighthouse/src/lib/runner/runner.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import type { Config, RunnerResult } from 'lighthouse';
22
import { runLighthouse } from 'lighthouse/cli/run.js';
33
import path from 'node:path';
44
import type { AuditOutputs, RunnerFunction } from '@code-pushup/models';
5-
import { ensureDirectoryExists, ui } from '@code-pushup/utils';
5+
import { ensureDirectoryExists, pluginWorkDir, ui } from '@code-pushup/utils';
6+
import { LIGHTHOUSE_PLUGIN_SLUG } from '../constants.js';
67
import { orderSlug, shouldExpandForUrls } from '../processing.js';
78
import type { LighthouseOptions } from '../types.js';
89
import { DEFAULT_CLI_FLAGS } from './constants.js';
@@ -19,6 +20,11 @@ export function createRunnerFunction(
1920
flags: LighthouseCliFlags = DEFAULT_CLI_FLAGS,
2021
): RunnerFunction {
2122
return async (): Promise<AuditOutputs> => {
23+
process.env['TEMP'] = path.join(
24+
pluginWorkDir(LIGHTHOUSE_PLUGIN_SLUG),
25+
'tmp',
26+
);
27+
2228
const config = await getConfig(flags);
2329
const normalizationFlags = enrichFlags(flags);
2430
const isSingleUrl = !shouldExpandForUrls(urls.length);

0 commit comments

Comments
 (0)