Skip to content

Commit

Permalink
Add a feature to allow users to pass files on the CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
Avaq committed Sep 8, 2019
1 parent 0a9cfeb commit 2dff936
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cli.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import concise from './report-concise.mjs'
import verbose from './report-verbose.mjs'
import crawl from './crawler.mjs'

crawl('./test/')
const eventualFiles = process.argv.length > 2
? Promise.resolve(process.argv.slice(2))
: crawl('./test/')

eventualFiles
.then(files => run(files, process.env.CI ? verbose : concise))
.then(({ passed, failed }) => failed ? process.exit(1) : process.exit(0))
.catch(err => {
Expand Down

0 comments on commit 2dff936

Please sign in to comment.