-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
68 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
const Promise = require('bluebird') | ||
const defaultFilter = require('../utils/filter') | ||
|
||
const mysqlHost = ({ option }) => { | ||
return { | ||
type: 'input', | ||
name: 'mysqlHost', | ||
message: 'Please enter mysql IPv4 host address: ', | ||
default: option ? option : '127.0.0.1:3306', | ||
filter: defaultFilter | ||
} | ||
} | ||
|
||
const mysqlUser = ({ option }) => { | ||
return { | ||
type: 'input', | ||
name: 'mysqlUser', | ||
message: 'Please enter mysql user name: ', | ||
default: option ? option : 'root', | ||
filter: defaultFilter | ||
} | ||
} | ||
|
||
const mysqlRootPassword = ({ option }) => { | ||
return { | ||
type: 'password', | ||
name: 'mysqlRootPassword', | ||
message: 'Please enter mysql user password: ', | ||
default: option ? option : null, | ||
filter: defaultFilter | ||
} | ||
} | ||
|
||
const mysqlDatabase = ({ option }) => { | ||
return { | ||
type: 'input', | ||
name: 'mysqlDatabase', | ||
message: 'Please enter mysql database name: ', | ||
default: option ? option : 'git_token', | ||
filter: defaultFilter | ||
} | ||
} | ||
|
||
module.exports = (options) => { | ||
return [ | ||
mysqlHost({ option: options['mysqlHost'] }), | ||
mysqlUser({ option: options['mysqlUser'] }), | ||
mysqlRootPassword({ option: options['mysqlRootPassword'] }), | ||
mysqlDatabase({ option: options['mysqlDatabase'] }) | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters