Error instead of warning on missing pages dir

This commit is contained in:
Dan Zajdband 2016-10-25 15:25:45 +01:00
parent 1bf98eaa6b
commit 37f76b16bc

View file

@ -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')
}
}
})