mirror of
https://github.com/openp2p-cn/openp2p.git
synced 2026-11-26 22:13:04 +08:00
Update install.go
This commit is contained in:
@@ -37,7 +37,7 @@ func install() {
|
||||
parseParams("install")
|
||||
targetPath := filepath.Join(defaultInstallPath, defaultBinName)
|
||||
d := daemon{}
|
||||
binPath, _ := os.Executable()
|
||||
binPath, _ := os.Executable() // can not use args[0], on Windows call openp2p is ok(=openp2p.exe)
|
||||
if targetPath != binPath {
|
||||
// copy files
|
||||
errFiles := copyFile(targetPath, binPath)
|
||||
@@ -63,7 +63,7 @@ func install() {
|
||||
}
|
||||
|
||||
func copyFile(dst, src string) error {
|
||||
srcF, err := os.Open(src) // can not use args[0], on Windows call openp2p is ok(=openp2p.exe)
|
||||
srcF, err := os.Open(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("os.Open %s error: %w", src, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user