-
Notifications
You must be signed in to change notification settings - Fork 926
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #735 from flycash/v1.12.3
V1.12.3
- Loading branch information
Showing
22 changed files
with
324 additions
and
167 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
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
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,38 @@ | ||
package update | ||
|
||
import ( | ||
"flag" | ||
"os" | ||
"os/exec" | ||
|
||
"github.com/beego/bee/cmd/commands" | ||
"github.com/beego/bee/config" | ||
beeLogger "github.com/beego/bee/logger" | ||
) | ||
|
||
var CmdUpdate = &commands.Command{ | ||
UsageLine: "update", | ||
Short: "Update Bee", | ||
Long: ` | ||
Automatic run command "go get -u github.com/beego/bee" for selfupdate | ||
`, | ||
Run: updateBee, | ||
} | ||
|
||
func init() { | ||
fs := flag.NewFlagSet("update", flag.ContinueOnError) | ||
CmdUpdate.Flag = *fs | ||
commands.AvailableCommands = append(commands.AvailableCommands, CmdUpdate) | ||
} | ||
|
||
func updateBee(cmd *commands.Command, args []string) int { | ||
beeLogger.Log.Info("Updating") | ||
beePath := config.GitRemotePath | ||
cmdUp := exec.Command("go", "get", "-u", beePath) | ||
cmdUp.Stdout = os.Stdout | ||
cmdUp.Stderr = os.Stderr | ||
if err := cmdUp.Run(); err != nil { | ||
beeLogger.Log.Warnf("Run cmd err:%s",err) | ||
} | ||
return 0 | ||
} |
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
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
Oops, something went wrong.