Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
[kbn/config] don't include x-pack/examples with --oss (elastic#79032)
Browse files Browse the repository at this point in the history
Co-authored-by: spalger <spalger@users.noreply.github.com>
  • Loading branch information
Spencer and spalger committed Oct 2, 2020
1 parent eda7292 commit 973126a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
12 changes: 12 additions & 0 deletions packages/kbn-config/src/env.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,18 @@ test('pluginSearchPaths contains x-pack/examples plugins path if --run-examples
expect(env.pluginSearchPaths).toContain('/some/home/dir/x-pack/examples');
});

test('pluginSearchPaths does not contain x-pack/examples plugins path if --oss flag is true', () => {
const env = new Env(
'/some/home/dir',
packageInfos,
getEnvOptions({
cliArgs: { runExamples: true, oss: true },
})
);

expect(env.pluginSearchPaths).not.toContain('/some/home/dir/x-pack/examples');
});

test('pluginSearchPaths does not contains examples plugins path if --run-examples flag is false', () => {
const env = new Env(
'/some/home/dir',
Expand Down
5 changes: 3 additions & 2 deletions packages/kbn-config/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ export class Env {
resolve(this.homeDir, 'src', 'plugins'),
...(options.cliArgs.oss ? [] : [resolve(this.homeDir, 'x-pack', 'plugins')]),
resolve(this.homeDir, 'plugins'),
...(options.cliArgs.runExamples
? [resolve(this.homeDir, 'examples'), resolve(this.homeDir, 'x-pack', 'examples')]
...(options.cliArgs.runExamples ? [resolve(this.homeDir, 'examples')] : []),
...(options.cliArgs.runExamples && !options.cliArgs.oss
? [resolve(this.homeDir, 'x-pack', 'examples')]
: []),
resolve(this.homeDir, '..', 'kibana-extra'),
];
Expand Down

0 comments on commit 973126a

Please sign in to comment.