PKGBUILD/main.go

38 lines
487 B
Go
Raw Normal View History

2018-11-07 19:07:15 +00:00
package main
import (
"log"
"os"
"os/user"
"github.com/Masterminds/semver"
2019-06-15 13:58:41 +00:00
"github.com/go-flucky/flucky/cmd"
2018-11-07 19:07:15 +00:00
)
var (
version string
)
2018-11-07 19:07:15 +00:00
func main() {
user, err := user.Current()
if err != nil {
panic(err)
}
if user.Uid != "0" {
log.Println("you need to be root to run this command")
os.Exit(1)
}
sversion, err := semver.NewVersion(version)
if err != nil {
log.Printf("The sematic versioning is invalid: %v", version)
os.Exit(1)
}
cmd.Execute(sversion)
2018-11-07 19:07:15 +00:00
}