From 8f08f139419f0199bcf7b5991f3c9210b5bc478b Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Sun, 21 May 2017 15:11:30 +0430 Subject: [PATCH] Revert "don't warn if pages directory not exists" This reverts commit c6556c6b8b3ff4a4591b32b2439ca161f52edb3f. --- lib/build.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/build.js b/lib/build.js index ab9b2571b4..4f255db972 100644 --- a/lib/build.js +++ b/lib/build.js @@ -97,6 +97,15 @@ export function options () { } export async function build () { + // Check if pages dir exists and warn if not + if (!fs.existsSync(join(this.srcDir, 'pages'))) { + if (fs.existsSync(join(this.srcDir, '..', 'pages'))) { + console.error('> No `pages` directory found. Did you mean to run `nuxt` in the parent (`../`) directory?') // eslint-disable-line no-console + } else { + console.error('> Couldn\'t find a `pages` directory. Please create one under the project root') // eslint-disable-line no-console + } + process.exit(1) + } debug(`App root: ${this.srcDir}`) debug('Generating .nuxt/ files...') // Create .nuxt/, .nuxt/components and .nuxt/dist folders