Skip to content

Commit

Permalink
fix: use runtime instead of fake runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke committed Jul 16, 2024
1 parent c90fb18 commit 67d116e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion 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"
"runtime"
"strings"

"github.com/aquaproj/aqua/v2/pkg/config"
Expand All @@ -29,7 +30,7 @@ func (is *Installer) createLinks(logE *logrus.Entry, pkgs []*config.Package) boo
for _, pkg := range pkgs {
pkgInfo := pkg.PackageInfo
for _, file := range pkgInfo.GetFiles() {
if isWindows(is.runtime.GOOS) {
if isWindows(runtime.GOOS) {
hardLink := filepath.Join(is.rootDir, "bin", file.Name+".exe")
if f, err := afero.Exists(is.fs, hardLink); err != nil {
logerr.WithError(logE, err).WithFields(logrus.Fields{
Expand Down
5 changes: 3 additions & 2 deletions pkg/installpackage/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"path/filepath"
"runtime"

"github.com/aquaproj/aqua/v2/pkg/checksum"
"github.com/aquaproj/aqua/v2/pkg/config"
Expand Down Expand Up @@ -87,7 +88,7 @@ func (is *Installer) InstallProxy(ctx context.Context, logE *logrus.Entry) error
}); err != nil {
return err
}
if isWindows(is.runtime.GOOS) {
if isWindows(runtime.GOOS) {
return is.recreateHardLinks()
}
} else { //nolint:gocritic
Expand All @@ -96,7 +97,7 @@ func (is *Installer) InstallProxy(ctx context.Context, logE *logrus.Entry) error
}
}

if isWindows(is.runtime.GOOS) {
if isWindows(runtime.GOOS) {
return nil
}

Expand Down

0 comments on commit 67d116e

Please sign in to comment.