legacy utils cleanup (#76608)

* move prompt to cli_keystore

* move binder to cli

* remove unused path_contains

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Mikhail Shustov 2020-09-09 18:57:32 +03:00 committed by GitHub
parent c7dac8000c
commit 7955a02437
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 5 additions and 31 deletions

View file

@ -21,7 +21,7 @@ import _ from 'lodash';
import cluster from 'cluster';
import { EventEmitter } from 'events';
import { BinderFor } from '../../legacy/utils/binder_for';
import { BinderFor } from './binder_for';
import { fromRoot } from '../../core/server/utils';
const cliPath = fromRoot('src/cli');

View file

@ -18,7 +18,7 @@
*/
import { Logger } from '../cli_plugin/lib/logger';
import { confirm, question } from '../legacy/server/utils';
import { confirm, question } from './utils';
import { createPromiseFromStreams, createConcatStream } from '../core/server/utils';
/**

View file

@ -42,7 +42,7 @@ import { PassThrough } from 'stream';
import { Keystore } from '../legacy/server/keystore';
import { add } from './add';
import { Logger } from '../cli_plugin/lib/logger';
import * as prompt from '../legacy/server/utils/prompt';
import * as prompt from './utils/prompt';
describe('Kibana keystore', () => {
describe('add', () => {

View file

@ -18,7 +18,7 @@
*/
import { Logger } from '../cli_plugin/lib/logger';
import { confirm } from '../legacy/server/utils';
import { confirm } from './utils';
export async function create(keystore, command, options) {
const logger = new Logger(options);

View file

@ -41,7 +41,7 @@ import sinon from 'sinon';
import { Keystore } from '../legacy/server/keystore';
import { create } from './create';
import { Logger } from '../cli_plugin/lib/logger';
import * as prompt from '../legacy/server/utils/prompt';
import * as prompt from './utils/prompt';
describe('Kibana keystore', () => {
describe('create', () => {

View file

@ -17,8 +17,6 @@
* under the License.
*/
export { BinderBase } from './binder';
export { BinderFor } from './binder_for';
export { deepCloneWithBuffers } from './deep_clone_with_buffers';
export { unset } from './unset';
export { IS_KIBANA_DISTRIBUTABLE } from './artifact_type';

View file

@ -1,24 +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.
*/
import { relative } from 'path';
export default function pathContains(root, child) {
return relative(child, root).slice(0, 2) !== '..';
}