Skip to content

Commit 000f8cd

Browse files
Merge pull request #693 from phawxby/glob-fix
Glob fix to prevent loading the wrong file
2 parents bb01a18 + b116e89 commit 000f8cd

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

core/lib/data_loader.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const glob = require('glob'),
1313
* @returns {*}
1414
*/
1515
function loadFile(dataFilesPath, fsDep) {
16-
const dataFilesFullPath = dataFilesPath + '*.{json,yml,yaml}';
16+
const dataFilesFullPath = dataFilesPath + '{.,[!-]*.}{json,yml,yaml}';
1717

1818
if (dataFilesPath) {
1919
const dataFiles = glob.sync(dataFilesFullPath),

test/files/_data/foo-other.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"foo": "wrong"
3+
}

0 commit comments

Comments
 (0)