Skip to content

Commit b472fea

Browse files
committed
add node build script
1 parent 22d217c commit b472fea

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

build/lib/node.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"use strict";
2+
/*---------------------------------------------------------------------------------------------
3+
* Copyright (c) Microsoft Corporation. All rights reserved.
4+
* Licensed under the MIT License. See License.txt in the project root for license information.
5+
*--------------------------------------------------------------------------------------------*/
6+
Object.defineProperty(exports, "__esModule", { value: true });
7+
const path = require("path");
8+
const fs = require("fs");
9+
const root = path.dirname(path.dirname(__dirname));
10+
const yarnrcPath = path.join(root, 'remote', '.yarnrc');
11+
const yarnrc = fs.readFileSync(yarnrcPath, 'utf8');
12+
const version = /^target\s+"([^"]+)"$/m.exec(yarnrc)[1];
13+
const node = process.platform === 'win32' ? 'node.exe' : 'node';
14+
const nodePath = path.join(root, '.build', 'node', `v${version}`, `${process.platform}-${process.arch}`, node);
15+
console.log(nodePath);

build/lib/node.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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 * as path from 'path';
7+
import * as fs from 'fs';
8+
9+
const root = path.dirname(path.dirname(__dirname));
10+
const yarnrcPath = path.join(root, 'remote', '.yarnrc');
11+
const yarnrc = fs.readFileSync(yarnrcPath, 'utf8');
12+
const version = /^target\s+"([^"]+)"$/m.exec(yarnrc)![1];
13+
const node = process.platform === 'win32' ? 'node.exe' : 'node';
14+
const nodePath = path.join(root, '.build', 'node', `v${version}`, `${process.platform}-${process.arch}`, node);
15+
16+
console.log(nodePath);

0 commit comments

Comments
 (0)