fix: remove root check
Changes: - The owner of the flucky binary must be root. To grant access to the binary and third party libs, for example wire1, gpio or i2c, the binary must have a sticky bit
This commit is contained in:
parent
b125bf432c
commit
39b3a495ac
14
main.go
14
main.go
@ -3,10 +3,8 @@ package main
|
|||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/user"
|
|
||||||
|
|
||||||
"github.com/Masterminds/semver"
|
"github.com/Masterminds/semver"
|
||||||
|
|
||||||
"github.com/go-flucky/flucky/cmd"
|
"github.com/go-flucky/flucky/cmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -15,18 +13,6 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
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)
|
sversion, err := semver.NewVersion(version)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("The sematic versioning is invalid: %v", version)
|
log.Printf("The sematic versioning is invalid: %v", version)
|
||||||
|
Loading…
Reference in New Issue
Block a user