Skip to content

Commit

Permalink
feat: allow multiple directories
Browse files Browse the repository at this point in the history
  • Loading branch information
SethFalco authored and vhf committed Oct 20, 2023
1 parent f267d4d commit 6f39fdb
Show file tree
Hide file tree
Showing 4 changed files with 194 additions and 787 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/fpb-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,4 @@ jobs:
- run: npm run test
- run: npm run lint
- run: npm install --global .
- run: fpb-lint $(pwd)/fpb/books/
- run: fpb-lint $(pwd)/fpb/casts/
- run: fpb-lint $(pwd)/fpb/courses/
- run: fpb-lint $(pwd)/fpb/more/
- run: fpb-lint $(pwd)/fpb/books/ $(pwd)/fpb/casts/ $(pwd)/fpb/courses/ $(pwd)/fpb/more/
33 changes: 26 additions & 7 deletions cli.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
#!/usr/bin/env node
const { lint } = require('./lib/lint')
const { program } = require('commander')

;((directory) => {
const failure = lint(directory)
if (failure) {
process.exit(1)
}
process.exit(0)
})(process.argv[2])
program.version('3.0.0')

program
.command('lint', null, { isDefault: true })
.argument('<dirs...>')
.description('lint the specified directories')
.action((directories) => {
let failure

for (const directory of directories) {
const failed = lint(directory)

if (failed) {
failure = true
}
}

if (failure) {
process.exit(1)
}

process.exit(0)
})

program.parse(process.argv)
Loading

0 comments on commit 6f39fdb

Please sign in to comment.