Skip to content

Commit

Permalink
fix: remove files without .exe on bin
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke committed Jul 16, 2024
1 parent f6c8e3f commit 0f4d162
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/installpackage/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"os"
"path/filepath"
"strings"

"github.com/aquaproj/aqua/v2/pkg/config"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -45,7 +46,7 @@ func (is *Installer) createLinks(logE *logrus.Entry, pkgs []*config.Package) boo
if err := is.linker.Hardlink(aquaProxyPathOnWindows, hardLink); err != nil {
logerr.WithError(logE, err).WithFields(logrus.Fields{
"command": file.Name,
}).Error("creating a hard link to aqua-proxy")
}).Error("create a hard link to aqua-proxy")
failed = true
}
continue
Expand Down Expand Up @@ -79,8 +80,10 @@ func (is *Installer) recreateHardLinks() error {
if err := is.fs.Remove(p); err != nil {
return fmt.Errorf("remove a file to replace it with a hard link: %w", err)
}
if err := is.linker.Hardlink(a, p); err != nil {
return fmt.Errorf("create a hard link: %w", err)
if strings.HasSuffix(info.Name(), ".exe") {
if err := is.linker.Hardlink(a, p); err != nil {
return fmt.Errorf("create a hard link: %w", err)
}
}
}
return nil
Expand Down

0 comments on commit 0f4d162

Please sign in to comment.