mirror of
https://github.com/bluszcz/cutego.git
synced 2024-09-28 21:25:16 +03:00
fix qtsetup/prep link issue
This commit is contained in:
parent
87e59bbdaa
commit
a94e900cd5
1 changed files with 6 additions and 0 deletions
|
@ -31,6 +31,9 @@ func Prep() {
|
|||
}
|
||||
dPath = filepath.Join(utils.QT_MSYS2_DIR(), "..", "usr", "bin", fmt.Sprintf("%v.exe", app))
|
||||
}
|
||||
if sPath == dPath {
|
||||
continue
|
||||
}
|
||||
utils.RemoveAll(dPath)
|
||||
//TODO: use os.Link to create a hardlink on windows
|
||||
utils.RunCmdOptional(exec.Command("cmd", "/C", "mklink", "/H", dPath, sPath), fmt.Sprintf(errString, app, dPath, sPath))
|
||||
|
@ -41,6 +44,9 @@ func Prep() {
|
|||
var dPath string
|
||||
for _, pdPath := range strings.Split("/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:"+filepath.Join(filepath.Join(runtime.GOROOT(), "bin")), string(os.PathListSeparator)) {
|
||||
dPath = filepath.Join(pdPath, app)
|
||||
if sPath == dPath {
|
||||
continue
|
||||
}
|
||||
utils.RemoveAll(dPath)
|
||||
if err := os.Symlink(sPath, dPath); err == nil {
|
||||
suc = true
|
||||
|
|
Loading…
Reference in a new issue