Skip to content

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

@vkoppen-itemis

Description

@vkoppen-itemis

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)
    }
  }
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions