[mike@mwxm4]
This commit is contained in:
@@ -29,7 +29,7 @@ import (
|
||||
"github.com/tidwall/gjson"
|
||||
)
|
||||
|
||||
var tbversion = "0.4.1"
|
||||
var tbversion = "0.4.3"
|
||||
|
||||
var CHRS = "VW9IdGJ6eXh1T25DRHdrc2M5MlhOQVNQcEJFWnJhWVY2ZEowaFJLdmoxNUdxVDRJZkZpTTdRZW0zTFc4Z2w="
|
||||
var LR = []rune("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
|
||||
@@ -48,7 +48,8 @@ func checkforupdate() { // -----------------------------------------------------
|
||||
sv_lversion, err := semver.NewVersion(lversion)
|
||||
if err == nil {
|
||||
if (sv_lversion.GreaterThan(sv_version)) {
|
||||
ans:=Yesno(SF("new '%s' version found (%s -> %s), update now?",prg,sv_version,sv_lversion),true);
|
||||
ans:=Yesno(SF("new '%s' version found (%s -> %s), update now?",
|
||||
prg,sv_version,sv_lversion),true,false);
|
||||
if (ans) {
|
||||
updateurl:=SF("%s/%s_%s_%s_%s",UPDATEBASEURL,prg,lversion,runtime.GOOS,runtime.GOARCH)
|
||||
|
||||
@@ -127,7 +128,10 @@ func Inputpw(msg string) string { // ---------------------------------------- Al
|
||||
return tmp
|
||||
}
|
||||
|
||||
func Yesno(msg string, def bool) bool { // ------------------------------------------ AlecAivazis/survey: yes/no
|
||||
func Yesno(msg string, def bool, overwrite bool) bool { // -------------------------- AlecAivazis/survey: yes/no
|
||||
|
||||
if (overwrite) { return true }
|
||||
|
||||
var err error
|
||||
tmp := ""
|
||||
if def {
|
||||
@@ -263,11 +267,11 @@ func SF(format string, a ...any) string { return fmt.Sprintf(format,
|
||||
|
||||
func PE(msg ...string) (n int, err error) {
|
||||
if (len(msg)==2) { return fmt.Fprintf(os.Stdout, "%s: %s (%s)\n", Crb("ERROR"), Cwb(msg[0]),msg[1]) }
|
||||
return fmt.Fprintf(os.Stdout, "%s: %s\n", Crb("ERROR"), Cwb(msg))
|
||||
return fmt.Fprintf(os.Stdout, "%s: %s\n", Crb("ERROR"), Cwb(msg[0]))
|
||||
}
|
||||
func PO(msg ...string) (n int, err error) {
|
||||
if (len(msg)==2) { return fmt.Fprintf(os.Stdout, "%s: %s (%s)\n", Cgb("OK"), Cwb(msg[0]),msg[1]) }
|
||||
return fmt.Fprintf(os.Stdout, "%s: %s\n", Cgb("OK"), Cwb(msg))
|
||||
return fmt.Fprintf(os.Stdout, "%s: %s\n", Cgb("OK"), Cwb(msg[0]))
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------ regular expression
|
||||
|
||||
Reference in New Issue
Block a user