void/build/lib/node.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
1.2 KiB
JavaScript
Raw Permalink Normal View History

2024-09-11 02:37:36 +00:00
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
2025-03-01 02:01:53 +00:00
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
2024-09-11 02:37:36 +00:00
Object.defineProperty(exports, "__esModule", { value: true });
2025-03-01 02:01:53 +00:00
const path_1 = __importDefault(require("path"));
const fs_1 = __importDefault(require("fs"));
const root = path_1.default.dirname(path_1.default.dirname(__dirname));
const npmrcPath = path_1.default.join(root, 'remote', '.npmrc');
const npmrc = fs_1.default.readFileSync(npmrcPath, 'utf8');
const version = /^target="(.*)"$/m.exec(npmrc)[1];
2024-09-11 02:37:36 +00:00
const platform = process.platform;
const arch = process.arch;
const node = platform === 'win32' ? 'node.exe' : 'node';
2025-03-01 02:01:53 +00:00
const nodePath = path_1.default.join(root, '.build', 'node', `v${version}`, `${platform}-${arch}`, node);
2024-09-11 02:37:36 +00:00
console.log(nodePath);
//# sourceMappingURL=node.js.map