mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Error instead of warning on missing pages dir
This commit is contained in:
parent
1bf98eaa6b
commit
37f76b16bc
|
@ -27,9 +27,9 @@ 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?')
|
||||
throw new 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')
|
||||
throw new Error('> Couldn\'t find a `pages` directory. Please create one under the project root')
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue