Skip to content

Commit e396173

Browse files
path fix
1 parent 9581f18 commit e396173

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • src/tasks/cwv-demo-suggestions-processor

src/tasks/cwv-demo-suggestions-processor/handler.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
import { isNonEmptyArray } from '@adobe/spacecat-shared-utils';
1414
import { readFileSync } from 'fs';
15-
import path from 'path';
15+
import { join } from 'path';
16+
import { fileURLToPath } from 'url';
1617
import { say } from '../../utils/slack-utils.js';
1718

1819
const TASK_TYPE = 'cwv-demo-suggestions-processor';
@@ -21,7 +22,9 @@ const CLS = 'cls';
2122
const INP = 'inp';
2223
const DEMO = 'demo';
2324
const MAX_CWV_DEMO_SUGGESTIONS = 2;
24-
const CWV_SUGGESTIONS_FILE_PATH = path.resolve(new URL('.', import.meta.url).pathname, '..', '..', 'static', 'aem-best-practices.json');
25+
const filename = fileURLToPath(import.meta.url);
26+
const dirname = join(filename, '..', '..', '..', '..');
27+
const CWV_SUGGESTIONS_FILE_PATH = join(dirname, 'static', 'aem-best-practices.json');
2528

2629
/**
2730
* CWV thresholds for determining if metrics have issues

0 commit comments

Comments
 (0)