forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_dependencies_task.ts
More file actions
56 lines (49 loc) · 1.57 KB
/
install_dependencies_task.ts
File metadata and controls
56 lines (49 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { relative } from 'path';
import type { Task } from '../lib';
import { exec } from '../lib';
const YARN_EXEC = process.env.npm_execpath || 'yarn';
const NODE_EXEC = process.execPath || 'node';
export const InstallDependencies: Task = {
description: 'Installing node_modules, including production builds of packages',
async run(config, log, build) {
await exec(
log,
YARN_EXEC,
[
'install',
'--non-interactive',
'--production',
'--ignore-optional',
'--pure-lockfile',
'--prefer-offline',
// We're using --no-bin-links to support systems that don't have symlinks.
// This is commonly seen in shared folders on virtual machines
'--no-bin-links',
],
{
cwd: build.resolvePath(),
}
);
await exec(
log,
NODE_EXEC,
[
config.resolveFromRepo('node_modules/.bin/patch-package'),
'--error-on-fail',
'--patch-dir',
relative(build.resolvePath(), config.resolveFromRepo('patches')),
],
{
cwd: build.resolvePath(),
}
);
},
};