This repository has been archived by the owner on Oct 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.js
78 lines (64 loc) · 2.23 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/env node
const chalk = require('chalk');
const clear = require('clear');
const figlet = require('figlet');
const program = require('commander');
const { exec } = require('child_process');
const utils = require('./lib/helpers/utils');
program.version('1.0.0').description('Vuetronex CLI');
program.command('new <name>')
.description('Make a new `Vuetronex` project')
.action(require('./lib/make').handle);
program.command('make:page <name>')
.description('Create a page component')
.action(require('./lib/page'));
program.command('make:component <name>')
.description('Create a component')
.action(require('./lib/component'));
program.command('make:model <name>')
.option('-m, --migration', 'Create migration file also')
.option('-s, --seed', 'Create seeder file also')
.description('Create a model')
.action(require('./lib/model'));
program.command('make:migration <name>')
.option('-a, --alter', 'Create for alter table')
.option('-s, --seed', 'Create a seeder file also')
.description('Make a migration file')
.action(require('./lib/migration'));
program.command('make:seed <name>')
.description('Make a seeder file')
.action(require('./lib/seed'));
program.command('migrate')
.description('Migrate to latest')
.action(function () {
exec(utils.bin('knex migrate:latest'), utils.handle);
});
program.command('migrate:rollback')
.description('Rollback last migration')
.action(function () {
exec(utils.bin('knex migrate:rollback'), utils.handle);
});
program.command('seed')
.description('Run the seeders')
.action(function () {
exec(utils.bin('knex seed:run'), utils.handle);
});
program.command('install')
.description('Rebuild & perform Post-Install')
.action(function () {
exec(`vex migrate`, function(error, out) {
utils.handle(error, out);
exec(`vex seed`, utils.handle);
exec(utils.bin('tailwind init tailwind.js'), utils.handle);
});
});
program.parse(process.argv);
if (process.argv.length == 2) {
clear();
console.log(
chalk.yellow(
figlet.textSync('Vuetronex', { horizontalLayout: 'full' })
)
);
program.help();
}