fix(goctl): repeat creation protoc-gen-goctl symlink (#1162)

master
zeromake 3 years ago committed by GitHub
parent 9c48e9ceab
commit 9fd3f752d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -5,7 +5,6 @@ import (
"os"
"path/filepath"
"runtime"
"syscall"
"github.com/logrusorgru/aurora"
"github.com/tal-tech/go-zero/core/load"
@ -686,11 +685,12 @@ func linkProtocGenGoctl() error {
if len(ext) > 0 {
target = target + ext
}
err = syscall.Unlink(target)
_, err = os.Lstat(target)
if err != nil && !os.IsNotExist(err) {
return err
}
if os.IsNotExist(err) {
return os.Symlink(path, target)
}
return nil
}

Loading…
Cancel
Save