Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursivity search and interpolation of directory missing in the ignore pattern in Section 2.5 #48

Open
vkoppen-itemis opened this issue Jan 15, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@vkoppen-itemis
Copy link

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)
    }
  }
})
@gvwilson gvwilson self-assigned this Jan 16, 2024
@gvwilson gvwilson added the bug Something isn't working label Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants