var fs=require('fs')
let appName=process.argv[2]
let appPath=__dirname+'/'+appName
if(fs.existsSync(appPath)){
console.log('目录已存在');
process.exit()
}
fs.mkdirSync(appPath)
fs.mkdirSync(appPath+'/css')
fs.mkdirSync(appPath+'/js')
fs.mkdirSync(appPath+'/view')
if(process.argv.includes('-i')){
fs.writeFileSync(appPath+'index.html',`
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
</body>
</html>`)
}
console.log('项目创建完成');