mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Merge pull request #46 from zeit/add/error-pages-dir
Error instead of warning on missing pages dir
This commit is contained in:
commit
cab1e90aad
|
@ -16,5 +16,5 @@ const dir = resolve(argv._[0] || '.')
|
|||
build(dir)
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
exit(1)
|
||||
process.exit(1)
|
||||
})
|
||||
|
|
|
@ -27,13 +27,14 @@ clean(dir)
|
|||
// Check if pages dir exists and warn if not
|
||||
if (!(await exists(join(dir, 'pages')))) {
|
||||
if (await exists(join(dir, '..', 'pages'))) {
|
||||
console.warn('> No `pages` directory found. Did you mean to run `next` in the parent (`../`) directory?')
|
||||
console.error('> No `pages` directory found. Did you mean to run `next` in the parent (`../`) directory?')
|
||||
} else {
|
||||
console.warn('> Couldn\'t find a `pages` directory. Please create one under the project root')
|
||||
console.error('> Couldn\'t find a `pages` directory. Please create one under the project root')
|
||||
}
|
||||
process.exit(1)
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
exit(1)
|
||||
process.exit(1)
|
||||
})
|
||||
|
|
|
@ -34,7 +34,7 @@ exists(join(dir, 'package.json'))
|
|||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
exit(1)
|
||||
process.exit(1)
|
||||
})
|
||||
|
||||
const basePackage = `{
|
||||
|
|
|
@ -24,5 +24,5 @@ srv.start(argv.port)
|
|||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
exit(1)
|
||||
process.exit(1)
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue