File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed
Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change 11import Command from './interface' ;
22import { MakeEntity , MakeDbView , MakeGraphql } from './make_entity' ;
3+ import TrampConfig from './tramp' ;
34
45export default Command ;
56
67export {
78 MakeEntity ,
89 MakeDbView ,
9- MakeGraphql
10+ MakeGraphql ,
11+ TrampConfig
1012} ;
Original file line number Diff line number Diff line change 1+ import Command from './interface' ;
2+ import DI from '../di' ;
3+
4+ export default class TrampConfig extends Command {
5+ static getName ( ) {
6+ return 'tramp:dump-config' ;
7+ }
8+
9+ static getDescription ( ) {
10+ return 'Print tramp cli required config json' ;
11+ }
12+
13+ static getSpec ( ) {
14+ return { } ;
15+ }
16+
17+ async run ( ) {
18+ const config = DI . get ( 'config' ) ;
19+ const dbConfig = config . get ( 'db' ) ;
20+ // eslint-disable-next-line no-console
21+ console . log ( JSON . stringify ( {
22+ connection : {
23+ host : dbConfig . replication . write . host ,
24+ user : dbConfig . replication . write . username ,
25+ password : dbConfig . replication . write . password ,
26+ database : dbConfig . database ,
27+ port : dbConfig . port
28+ } ,
29+ editor : config . get ( 'dev.editor' ) || 'webstorm' ,
30+ paths : dbConfig . migrationPaths
31+ } ) ) ;
32+ }
33+ }
34+
You can’t perform that action at this time.
0 commit comments