From 46be2d4d61affd5170f3c9f2fb07d053e1f2870b Mon Sep 17 00:00:00 2001 From: Spencer Date: Wed, 13 May 2020 01:52:22 -0700 Subject: [PATCH] [plugin-helpers] remove outdated postinstall task (#66324) (#66338) --- packages/kbn-plugin-helpers/cli.js | 2 - packages/kbn-plugin-helpers/lib/tasks.js | 2 - .../tasks/postinstall/index.js | 44 ------------------- 3 files changed, 48 deletions(-) delete mode 100644 packages/kbn-plugin-helpers/tasks/postinstall/index.js diff --git a/packages/kbn-plugin-helpers/cli.js b/packages/kbn-plugin-helpers/cli.js index c6fc48bc5be9a..48b70535272fe 100644 --- a/packages/kbn-plugin-helpers/cli.js +++ b/packages/kbn-plugin-helpers/cli.js @@ -88,6 +88,4 @@ program })) ); -program.command('postinstall').action(createCommanderAction('postinstall')); - program.parse(process.argv); diff --git a/packages/kbn-plugin-helpers/lib/tasks.js b/packages/kbn-plugin-helpers/lib/tasks.js index 0e33e2086d9c4..afc9c056d51d7 100644 --- a/packages/kbn-plugin-helpers/lib/tasks.js +++ b/packages/kbn-plugin-helpers/lib/tasks.js @@ -22,7 +22,6 @@ const startTask = require('../tasks/start'); const testAllTask = require('../tasks/test/all'); const testKarmaTask = require('../tasks/test/karma'); const testMochaTask = require('../tasks/test/mocha'); -const postinstallTask = require('../tasks/postinstall'); module.exports = { build: buildTask, @@ -30,5 +29,4 @@ module.exports = { testAll: testAllTask, testKarma: testKarmaTask, testMocha: testMochaTask, - postinstall: postinstallTask, }; diff --git a/packages/kbn-plugin-helpers/tasks/postinstall/index.js b/packages/kbn-plugin-helpers/tasks/postinstall/index.js deleted file mode 100644 index 9522e1e0e8998..0000000000000 --- a/packages/kbn-plugin-helpers/tasks/postinstall/index.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -const resolve = require('path').resolve; -const statSync = require('fs').statSync; - -module.exports = function(plugin) { - if ( - fileExists(resolve(plugin.root, '../kibana/package.json')) && - !fileExists(resolve(plugin.root, '../../kibana/package.json')) - ) { - process.stdout.write( - '\nWARNING: Kibana now requires that plugins must be located in ' + - '`../kibana-extra/{pluginName}` relative to the Kibana folder ' + - 'during development. We found a Kibana in `../kibana`, but not in ' + - '`../../kibana`.\n' - ); - } -}; - -function fileExists(path) { - try { - const stat = statSync(path); - return stat.isFile(); - } catch (e) { - return false; - } -}