mirror of
https://github.com/casbin/bee.git
synced 2025-07-20 06:04:20 +08: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:
4
fix.go
4
fix.go
@ -23,12 +23,12 @@ bee fix help to upgrade the application to beego 1.6
|
||||
|
||||
func init() {
|
||||
cmdFix.Run = runFix
|
||||
cmdFix.PreRun = func(cmd *Command, args []string) { ShowShortVersionBanner() }
|
||||
}
|
||||
|
||||
func runFix(cmd *Command, args []string) int {
|
||||
ShowShortVersionBanner()
|
||||
|
||||
logger.Info("Upgrading the application...")
|
||||
|
||||
dir, err := os.Getwd()
|
||||
if err != nil {
|
||||
logger.Fatalf("Error while getting the current working directory: %s", err)
|
||||
|
Reference in New Issue
Block a user