console.log('`next init` is not supported anymore. These community projects provide the same functionality as `next init` with additional features: http://npmjs.com/next-init and http://npmjs.com/create-next-app.')
importparseArgsfrom'minimist'
import{exists,writeFile,mkdir}from'mz/fs'
importmkdirpfrom'mkdirp-then'
constargv=parseArgs(process.argv.slice(2),{
process.exit(0)
alias:{
h:'help'
},
boolean:['h']
})
if(argv.help){
console.log(`
Description
Scaffolds a simple project structure to get started quickly
Usage
$ next init <dir>
If no directory is provided the current directory will be used.
Options
--help, -h Displays this message
`)
process.exit(0)
}
constdir=resolve(argv._[0]||'.')
if(basename(dir)==='pages'){
console.warn('Your root directory is named "pages". This looks suspicious. You probably want to go one directory up.')