|
5 | 5 |
|
6 | 6 | const cp = require('child_process'); |
7 | 7 | const path = require('path'); |
| 8 | +const fs = require('fs'); |
8 | 9 | const yarn = process.platform === 'win32' ? 'yarn.cmd' : 'yarn'; |
9 | 10 |
|
10 | 11 | function yarnInstall(location, opts) { |
@@ -46,15 +47,22 @@ const extensions = [ |
46 | 47 | extensions.forEach(extension => yarnInstall(`extensions/${extension}`)); |
47 | 48 |
|
48 | 49 | function yarnInstallBuildDependencies() { |
49 | | - // make sure we install gulp watch for the system installed |
| 50 | + // make sure we install the deps of build/lib/watch for the system installed |
50 | 51 | // node, since that is the driver of gulp |
51 | 52 | const env = Object.assign({}, process.env); |
| 53 | + const watchPath = path.join(path.dirname(__dirname), 'lib', 'watch'); |
| 54 | + const yarnrcPath = path.join(watchPath, '.yarnrc'); |
52 | 55 |
|
53 | | - delete env['npm_config_disturl']; |
54 | | - delete env['npm_config_target']; |
55 | | - delete env['npm_config_runtime']; |
| 56 | + const disturl = 'https://nodejs.org/download/release'; |
| 57 | + const target = process.versions.node; |
| 58 | + const runtime = 'node'; |
56 | 59 |
|
57 | | - yarnInstall(path.join(path.dirname(__dirname), 'lib', 'watch'), { env }); |
| 60 | + const yarnrc = `disturl "${disturl}" |
| 61 | +target "${target}" |
| 62 | +runtime "${runtime}"`; |
| 63 | + |
| 64 | + fs.writeFileSync(yarnrcPath, yarnrc, 'utf8'); |
| 65 | + yarnInstall(watchPath, { env }); |
58 | 66 | } |
59 | 67 |
|
60 | 68 | yarnInstall(`build`); // node modules required for build |
|
0 commit comments