Skip to content

Commit cab1e90

Browse files
authored
Merge pull request vercel#46 from zeit/add/error-pages-dir
Error instead of warning on missing pages dir
2 parents 049d2fe + 38efb9f commit cab1e90

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

bin/next-build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ const dir = resolve(argv._[0] || '.')
1616
build(dir)
1717
.catch((err) => {
1818
console.error(err)
19-
exit(1)
19+
process.exit(1)
2020
})

bin/next-dev

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@ clean(dir)
2727
// Check if pages dir exists and warn if not
2828
if (!(await exists(join(dir, 'pages')))) {
2929
if (await exists(join(dir, '..', 'pages'))) {
30-
console.warn('> No `pages` directory found. Did you mean to run `next` in the parent (`../`) directory?')
30+
console.error('> No `pages` directory found. Did you mean to run `next` in the parent (`../`) directory?')
3131
} else {
32-
console.warn('> Couldn\'t find a `pages` directory. Please create one under the project root')
32+
console.error('> Couldn\'t find a `pages` directory. Please create one under the project root')
3333
}
34+
process.exit(1)
3435
}
3536
})
3637
.catch((err) => {
3738
console.error(err)
38-
exit(1)
39+
process.exit(1)
3940
})

bin/next-init

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ exists(join(dir, 'package.json'))
3434
})
3535
.catch((err) => {
3636
console.error(err)
37-
exit(1)
37+
process.exit(1)
3838
})
3939

4040
const basePackage = `{

bin/next-start

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ srv.start(argv.port)
2424
})
2525
.catch((err) => {
2626
console.error(err)
27-
exit(1)
27+
process.exit(1)
2828
})

0 commit comments

Comments
 (0)