Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/build/lib/node.ts
3520 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import path from 'path';
7
import fs from 'fs';
8
9
const root = path.dirname(path.dirname(__dirname));
10
const npmrcPath = path.join(root, 'remote', '.npmrc');
11
const npmrc = fs.readFileSync(npmrcPath, 'utf8');
12
const version = /^target="(.*)"$/m.exec(npmrc)![1];
13
14
const platform = process.platform;
15
const arch = process.arch;
16
17
const node = platform === 'win32' ? 'node.exe' : 'node';
18
const nodePath = path.join(root, '.build', 'node', `v${version}`, `${platform}-${arch}`, node);
19
20
console.log(nodePath);
21
22