Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

Commit

Permalink
Upgrade node-ignore -> 3.x to solve several known issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kael committed Mar 9, 2016
1 parent e0d0170 commit 33dd62f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"coffee-script": "^1.9.1",
"coffeeify": "~1.0.0",
"glob": "^4.0.0",
"ignore": "^2.2.15",
"ignore": "^3.0.9",
"optimist": "^0.6.1",
"resolve": "^0.6.3",
"strip-json-comments": "^1.0.2"
Expand Down
12 changes: 10 additions & 2 deletions src/commandline.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ findCoffeeScripts = (paths, extension) ->
files = files.concat(glob.sync("#{p}/**/*.#{allExtention}"))
else
files.push(p)
return files
# Normalize paths, converting './test/fixtures' to 'test/fixtures'.
# Ignore pattern 'test/fixtures' does NOT match './test/fixtures',
# because if there is a slash(/) in the pattern, the pattern will not
# act as a glob pattern.
# Use `path.join()` instead of `path.normalize()` for better compatibility.
return files.map((p) -> path.join(p))

# Return an error report from linting the given paths.
lintFiles = (files, config) ->
Expand Down Expand Up @@ -247,7 +252,10 @@ else
# Find scripts to lint.
paths = options.argv._
scripts = findCoffeeScripts(paths, options.argv.ext)
scripts = ignore().addIgnoreFile('.coffeelintignore').filter(scripts)
if fs.existsSync('.coffeelintignore')
scripts = ignore()
.add(fs.readFileSync('.coffeelintignore').toString())
.filter(scripts)

# Lint the code.
errorReport = lintFiles(scripts, config, options.argv.literate)
Expand Down

0 comments on commit 33dd62f

Please sign in to comment.