mirror of
https://github.com/taigrr/go-selfupdate
synced 2025-01-18 04:33:12 -08:00
Refactor
This commit is contained in:
parent
f66156413e
commit
15d118d3bd
13
main.go
13
main.go
@ -130,14 +130,21 @@ func printUsage() {
|
|||||||
fmt.Println("\tCross platform: go-selfupdate /tmp/mybinares/ 1.2")
|
fmt.Println("\tCross platform: go-selfupdate /tmp/mybinares/ 1.2")
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func isArgsPresent() bool {
|
||||||
plat = os.Getenv("GOOS") + "-" + os.Getenv("GOARCH")
|
|
||||||
|
|
||||||
if len(os.Args) < 2 {
|
if len(os.Args) < 2 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
if isArgsPresent() == false {
|
||||||
printUsage()
|
printUsage()
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
plat = os.Getenv("GOOS") + "-" + os.Getenv("GOARCH")
|
||||||
appPath = os.Args[1]
|
appPath = os.Args[1]
|
||||||
version = os.Args[2]
|
version = os.Args[2]
|
||||||
genDir = "public"
|
genDir = "public"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user