In glob-filter-with-options.js only files with ending ".bck" in the same directory are ignored and in glob-with-source-directory.js in the ignore pattern the insertion of the parameter srcDir is missing.
Specifically, in the file glob-filter-with-options.js
import glob from 'glob'
glob('**/*.*', { ignore: '*.bck' }, (err, files) => {
if (err) {
console.log(err)
} else {
for (const filename of files) {
console.log(filename)
}
}
})
should be changed to:
import glob from 'glob'
glob('**/*.*', { ignore: '*.bck' }, (err, files) => {
if (err) {
console.log(err)
} else {
for (const filename of files) {
console.log(filename)
}
}
})
and in the file glob-with-source-directory.js
import glob from 'glob'
const srcDir = process.argv[2]
glob(`${srcDir}/**/*.*`, { ignore: '*.bck' }, (err, files) => {
if (err) {
console.log(err)
} else {
for (const filename of files) {
console.log(filename)
}
}
}).
should be changed to
import glob from 'glob'
const srcDir = process.argv[2]
glob(`${srcDir}/**/*.*`, { ignore: `${srcDir}/**/*.bck` }, (err, files) => {
if (err) {
console.log(err)
} else {
for (const filename of files) {
console.log(filename)
}
}
})
In
glob-filter-with-options.js
only files with ending ".bck" in the same directory are ignored and inglob-with-source-directory.js
in the ignore pattern the insertion of the parametersrcDir
is missing.Specifically, in the file
glob-filter-with-options.js
should be changed to:
and in the file
glob-with-source-directory.js
should be changed to