1
0
mirror of https://github.com/taigrr/go-selfupdate synced 2025-01-18 04:33:12 -08:00
This commit is contained in:
Mark Sanborn 2014-08-08 17:33:06 -07:00
parent f66156413e
commit 15d118d3bd

13
main.go
View File

@ -130,14 +130,21 @@ func printUsage() {
fmt.Println("\tCross platform: go-selfupdate /tmp/mybinares/ 1.2")
}
func main() {
plat = os.Getenv("GOOS") + "-" + os.Getenv("GOARCH")
func isArgsPresent() bool {
if len(os.Args) < 2 {
return false
}
return true
}
func main() {
if isArgsPresent() == false {
printUsage()
os.Exit(0)
}
plat = os.Getenv("GOOS") + "-" + os.Getenv("GOARCH")
appPath = os.Args[1]
version = os.Args[2]
genDir = "public"