mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[timelion] Fix glob path on windows (#152866)
Fixes a bug introduced in #138571. Paths need to be normalized before being passed to our current version of globby. Closes #150396
This commit is contained in:
parent
7a5264b53f
commit
f134d2e44c
1 changed files with 3 additions and 2 deletions
|
@ -9,6 +9,7 @@
|
|||
import _ from 'lodash';
|
||||
import globby from 'globby';
|
||||
import path from 'path';
|
||||
import normalizePath from 'normalize-path';
|
||||
import processFunctionDefinition from './process_function_definition';
|
||||
|
||||
export default function (directory) {
|
||||
|
@ -19,7 +20,7 @@ export default function (directory) {
|
|||
// Get a list of all files and use the filename as the object key
|
||||
const files = _.map(
|
||||
globby
|
||||
.sync(path.resolve(__dirname, '../' + directory + '/*.js'))
|
||||
.sync(normalizePath(path.resolve(__dirname, '../' + directory + '/*.js')))
|
||||
.filter((filename) => !filename.includes('.test')),
|
||||
function (file) {
|
||||
const name = file.substring(file.lastIndexOf('/') + 1, file.lastIndexOf('.'));
|
||||
|
@ -29,7 +30,7 @@ export default function (directory) {
|
|||
|
||||
// Get a list of all directories with an index.js, use the directory name as the key in the object
|
||||
const directories = _.chain(
|
||||
globby.sync(path.resolve(__dirname, '../' + directory + '/*/index.js'))
|
||||
globby.sync(normalizePath(path.resolve(__dirname, '../' + directory + '/*/index.js')))
|
||||
)
|
||||
.map(function (file) {
|
||||
const parts = file.split('/');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue