Skip to content

Commit 59d3938

Browse files
committed
exit on help message and add logs
1 parent cfc0b33 commit 59d3938

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/bin.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Options:
4848
-s, --static <dir> Static files directory (multiple allowed)
4949
--help Show this message
5050
`)
51+
process.exit()
5152
}
5253

5354
if (values.version) {
@@ -63,12 +64,6 @@ const file = positionals[0] ?? ''
6364
const port = parseInt(values.port ?? process.env['PORT'] ?? '3000')
6465
const host = values.host ?? process.env['HOST'] ?? 'localhost'
6566

66-
// Check file
67-
if (file === '') {
68-
console.log('No file specified')
69-
process.exit(1)
70-
}
71-
7267
if (!existsSync(file)) {
7368
console.log(`File ${file} not found`)
7469
process.exit(1)
@@ -125,5 +120,6 @@ if (process.env['NODE_ENV'] !== 'production') {
125120

126121
app.listen(port, () => {
127122
console.log(`Started on :${port}`)
123+
console.log(`Watching ${file}...`)
128124
console.log(routes(db).join('\n'))
129125
})

0 commit comments

Comments
 (0)