mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
fix build
task when yarn is not installed
Original commit: elastic/kibana-plugin-helpers@d48808f8d8
This commit is contained in:
parent
3a2a636da0
commit
6611bc4c8f
2 changed files with 3 additions and 6 deletions
|
@ -35,7 +35,6 @@ module.exports = function createBuild(plugin, buildTarget, buildVersion, kibanaV
|
|||
})
|
||||
.then(function () {
|
||||
// install packages in build
|
||||
var cmd = winCmd('npm');
|
||||
var options = {
|
||||
cwd: buildRoot,
|
||||
stdio: ['ignore', 'ignore', 'pipe'],
|
||||
|
@ -43,12 +42,11 @@ module.exports = function createBuild(plugin, buildTarget, buildVersion, kibanaV
|
|||
|
||||
try {
|
||||
// use yarn if yarn lockfile is found in the build
|
||||
cmd = winCmd('yarn');
|
||||
statSync(join(buildRoot, 'yarn.lock'));
|
||||
execFileSync(cmd, ['install', '--production'], options);
|
||||
execFileSync(winCmd('yarn'), ['install', '--production'], options);
|
||||
} catch (e) {
|
||||
// use npm if there is no yarn lockfile in the build
|
||||
execFileSync(cmd, ['install', '--production', '--no-bin-links'], options);
|
||||
execFileSync(winCmd('npm'), ['install', '--production', '--no-bin-links'], options);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
@ -14,10 +14,9 @@ module.exports = function testBrowserAction(plugin, run, options) {
|
|||
kbnServerArgs.push('--kbnServer.tests_bundle.pluginId=' + plugin.id);
|
||||
}
|
||||
|
||||
var cmd = winCmd('npm');
|
||||
var task = (options.dev) ? 'test:dev' : 'test:browser';
|
||||
var args = ['run', task, '--'].concat(kbnServerArgs);
|
||||
execFileSync(cmd, args, {
|
||||
execFileSync(winCmd('npm'), args, {
|
||||
cwd: plugin.kibanaRoot,
|
||||
stdio: ['ignore', 1, 2]
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue