Skip to content

Commit 3505ce2

Browse files
committed
feat(cli): Add exit codes.
* Display errors with `console.log`. * Add process.exit call with the output of the script. Closes #4
1 parent 8bddc3e commit 3505ce2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ readdir(folder, (err, files) => {
2626
}
2727
catch (e) {
2828
failed++
29-
console.log(cross, file, `\n\t${replaceall('\n', '\n\t', e.toString())}`)
29+
console.error(cross, file, `\n\t${replaceall('\n', '\n\t', e.toString())}`)
3030
}
3131
if (passed+failed === files.length) {
3232
console.log('\n')
3333
console.log(' ', check, passed, 'valid files')
3434
console.log(' ', cross, failed, 'invalid files')
3535
console.log('\n')
36+
process.exit(failed)
3637
}
3738
})
38-
}
39+
}
3940
})
4041
})
41-

0 commit comments

Comments
 (0)