mirror of
https://github.com/beego/bee.git
synced 2025-07-12 04:41:01 +00:00
Added PreRun phase to Command struct
Now each command has a PreRun function that will execute before calling the Run() function. This allows to show the banner and do some pre-check work. Also moved parsePackagesFromDir() to the main function to avoid getting called each time 'bee' is invoked.
This commit is contained in:
@ -56,14 +56,13 @@ var mConn docValue
|
||||
|
||||
func init() {
|
||||
cmdMigrate.Run = runMigration
|
||||
cmdMigrate.PreRun = func(cmd *Command, args []string) { ShowShortVersionBanner() }
|
||||
cmdMigrate.Flag.Var(&mDriver, "driver", "database driver: mysql, postgres, sqlite, etc.")
|
||||
cmdMigrate.Flag.Var(&mConn, "conn", "connection string used by the driver to connect to a database instance")
|
||||
}
|
||||
|
||||
// runMigration is the entry point for starting a migration
|
||||
func runMigration(cmd *Command, args []string) int {
|
||||
ShowShortVersionBanner()
|
||||
|
||||
currpath, _ := os.Getwd()
|
||||
|
||||
gps := GetGOPATHs()
|
||||
|
Reference in New Issue
Block a user