From 0b5c903d89c39216979452d30fc50cb93861e67d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B2=B3?= Date: Fri, 27 Dec 2019 10:59:56 +0800 Subject: [PATCH] fix update --- lib/install/install.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/install/install.go b/lib/install/install.go index 66bb28b..6156e3f 100644 --- a/lib/install/install.go +++ b/lib/install/install.go @@ -91,11 +91,13 @@ func copyStaticFile(srcPath, bin string) string { if _, err := copyFile(filepath.Join(srcPath, bin), "/usr/local/bin/"+bin); err != nil { log.Fatalln(err) } else { - copyFile(filepath.Join(srcPath, "nps"), "/usr/local/bin/"+bin+"-update") + copyFile(filepath.Join(srcPath, bin), "/usr/local/bin/"+bin+"-update") + chMod("/usr/local/bin/"+bin+"-update", 0755) binPath = "/usr/local/bin/" + bin } } else { - copyFile(filepath.Join(srcPath, "nps"), "/usr/bin/"+bin+"-update") + copyFile(filepath.Join(srcPath, bin), "/usr/bin/"+bin+"-update") + chMod("/usr/bin/"+bin+"-update", 0755) binPath = "/usr/bin/" + bin } } else {