File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env node
2
-
3
- import { resolve } from 'path'
2
+ import { resolve , join } from 'path'
4
3
import parseArgs from 'minimist'
5
4
import Server from '../server'
6
5
import build from '../server/build'
6
+ import { exists } from 'mz/fs'
7
7
8
8
const argv = parseArgs ( process . argv . slice ( 2 ) , {
9
9
alias : {
@@ -23,6 +23,15 @@ build(dir)
23
23
const srv = new Server ( { dir, dev : true } )
24
24
await srv . start ( argv . port )
25
25
console . log ( '> Ready on http://localhost:%d' , argv . port )
26
+
27
+ // Check if pages dir exists and warn if not
28
+ if ( ! await exists ( join ( dir , 'pages' ) ) ) {
29
+ if ( await exists ( join ( dir , '..' , 'pages' ) ) ) {
30
+ console . warn ( '> No `pages` directory found. Did you mean to run `next` in the parent (`../`) directory?' )
31
+ } else {
32
+ console . warn ( '> Couldn\'t find a `pages` directory. Please create one under the project root' )
33
+ }
34
+ }
26
35
} )
27
36
. catch ( ( err ) => {
28
37
console . error ( err )
You can’t perform that action at this time.
0 commit comments