Skip to content

Commit cf30446

Browse files
committed
Fix import of #dev/paths in yarn.config.cjs
1 parent 0117f42 commit cf30446

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

yarn.config.cjs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
const fs = require("node:fs/promises");
88
const { defineConfig } = require("@yarnpkg/types");
99

10-
const { compilerVersionFile } = require("#dev/paths");
11-
1210
/**
1311
* @param {Yarn.Constraints.Context} ctx
1412
*/
@@ -46,23 +44,21 @@ async function enforceCompilerMeta({ Yarn }) {
4644
}
4745
}
4846

47+
const { compilerVersionFile } = await import("#dev/paths");
4948
const versionFile = await fs.readFile(compilerVersionFile, "utf8");
5049
const versionPattern = /^let version = "(?<version>[^"]+)"$/m;
5150

5251
if (process.argv.includes("--fix")) {
5352
await fs.writeFile(
5453
compilerVersionFile,
55-
versionFile.replace(
56-
versionPattern,
57-
`let version = "${EXPECTED_VERSION}"`,
58-
),
54+
versionFile.replace(versionPattern, `let version = "${EXPECTED_VERSION}"`)
5955
);
6056
} else {
6157
const versionMatch = versionFile.match(versionPattern);
6258
const foundVersion = versionMatch?.groups?.version;
6359
if (foundVersion !== EXPECTED_VERSION) {
6460
Yarn.workspace().error(
65-
`compiler/common/bs_version.ml file need to be fixed; expected ${EXPECTED_VERSION}, found ${foundVersion}.`,
61+
`compiler/common/bs_version.ml file need to be fixed; expected ${EXPECTED_VERSION}, found ${foundVersion}.`
6662
);
6763
}
6864
}

0 commit comments

Comments
 (0)