import { resolve } from 'path' ; import { getConfigPath } from '@kbn/utils' ; import { getArgValues } from './read_argv' ; /**
 * Return the configuration files that needs to be loaded.
 *
 * This mimics the behavior of the `src/cli/serve/serve.js` cli script by reading
 * `-c` and `--config` options from process.argv, and fallbacks to `@kbn/utils`'s `getConfigPath()`
 */ export const getConfigurationFilePaths = ( argv ) : string [ ] => { const rawPaths = getArgValues ( argv , [ '-c' , '--config' ] ) ; if ( rawPaths . length ) { return rawPaths . map ( ( path ) => resolve ( process . cwd ( ) , path ) ) ; } return [ getConfigPath ( ) ] ; } ;