sdxjs
sdxjs copied to clipboard
Recursivity search and interpolation of directory missing in the ignore pattern in Section 2.5
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)
}
}
})