Skip to content

Commit 1b88861

Browse files
authored
Fix Update download.js
1 parent bb5714f commit 1b88861

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/download.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import { downloadNodeBinary, fetchLatestNodeVersion } from "./nodeDownloader.js";
22
import fs from 'fs';
3-
const platforms = JSON.parse(fs.readFileSync('./platforms.json', 'utf-8'));
3+
// Get the directory of the current module
4+
const __filename = fileURLToPath(import.meta.url);
5+
const __dirname = path.dirname(__filename);
46

7+
// Use an absolute path to the platforms.json file
8+
const platforms = JSON.parse(fs.readFileSync(path.join(__dirname, 'platforms.json'), 'utf-8'));
59

610
(async () => {
711
try {

0 commit comments

Comments
 (0)