mirror of
https://github.com/filiprojek/nork.git
synced 2024-11-02 18:12:28 +01:00
55 lines
1.6 KiB
Plaintext
55 lines
1.6 KiB
Plaintext
// console.log(process.argv)
|
|
let arguments = process.argv
|
|
const fs = require('fs')
|
|
|
|
if (arguments[ 2 ] == 'init')
|
|
{
|
|
let path = __dirname
|
|
let paths = [
|
|
__dirname + '/views',
|
|
__dirname + '/models',
|
|
__dirname + '/controllers',
|
|
__dirname + '/public',
|
|
__dirname + '/routes',
|
|
__dirname + '/tests',
|
|
__dirname + '/utils',
|
|
__dirname + '/',
|
|
]
|
|
let pathsTypescript = {}
|
|
for (let i = 0; i < paths.length; i++)
|
|
{
|
|
fs.mkdir(paths[ i ], (err) => {
|
|
if (err) {
|
|
console.log(err)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
if (arguments[ 2 ].includes('make:'))
|
|
{
|
|
switch (arguments[ 2 ].split('make:')[ 1 ])
|
|
{
|
|
case 'view':
|
|
// console.log("\x1b[32m%s\x1b[0m", 'View created successfully.')
|
|
console.log("\x1b[33m%s\x1b[0m", 'Views coming soon.')
|
|
break
|
|
case 'model':
|
|
console.log("\x1b[32m%s\x1b[0m", 'Model created successfully.')
|
|
break
|
|
case 'controller':
|
|
console.log("\x1b[32m%s\x1b[0m", 'Controller created successfully.')
|
|
break
|
|
case 'test':
|
|
console.log("\x1b[33m%s\x1b[0m", 'Tests coming soon.')
|
|
break
|
|
case 'middleware':
|
|
console.log("\x1b[33m%s\x1b[0m", 'Middlewares coming soon.')
|
|
break
|
|
case 'routes':
|
|
console.log("\x1b[33ms\x1b[0m", 'Routes coming soon.')
|
|
break
|
|
default:
|
|
console.log("\x1b[41m\x1b[37m%s\x1b[0m", 'node artisan make:view | model | controller | test | middleware | routes')
|
|
}
|
|
} |