Skip to content

Commit

Permalink
add executable permission for defined binary
Browse files Browse the repository at this point in the history
  • Loading branch information
MrLYC committed May 7, 2023
1 parent 5bae55f commit f1463d6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/utils/pathlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,13 @@ func (p *PathHelper) SymbolLink(name, target string, mode os.FileMode) error {
return errors.Wrapf(err, "get abs target path %s failed", target)
}

err = os.Symlink(absTarget, p.Child(name).Path())
linkFile := p.Child(name).Path()
err = os.Symlink(absTarget, linkFile)
if err != nil {
return errors.Wrapf(err, "create symbol link failed")
}

return os.Chmod(target, os.ModeSymlink|mode)
return os.Chmod(linkFile, os.ModeSymlink|mode)
}

func (p *PathHelper) CopyFile(name, target string, mode os.FileMode) error {
Expand All @@ -116,7 +117,7 @@ func (p *PathHelper) CopyFile(name, target string, mode os.FileMode) error {
return errors.WithMessagef(err, "copy file failed")
}

return os.Chmod(target, mode)
return os.Chmod(path, mode)
}

func (p *PathHelper) RealPath(name string) (string, error) {
Expand Down

0 comments on commit f1463d6

Please sign in to comment.