Skip to content

Commit e216027

Browse files
committed
simplify error message
1 parent e851560 commit e216027

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

internal/nix/nix.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,6 @@ var nixPlatforms = []string{
190190
"armv7l-linux",
191191
}
192192

193-
func SupportedPlatforms() []string {
194-
return nixPlatforms
195-
}
196-
197193
// EnsureValidPlatform returns an error if the platform is not supported by nix.
198194
// https://nixos.org/manual/nix/stable/installation/supported-platforms.html
199195
func EnsureValidPlatform(platforms ...string) error {

internal/nix/nixprofile/profile.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313

1414
"github.com/fatih/color"
1515
"github.com/pkg/errors"
16-
"github.com/samber/lo"
1716
"go.jetpack.io/devbox/internal/boxcli/usererr"
1817
"go.jetpack.io/devbox/internal/devpkg"
1918
"go.jetpack.io/devbox/internal/lock"
@@ -272,16 +271,11 @@ func ProfileInstall(args *ProfileInstallArgs) error {
272271
} else {
273272
platform = " " + platform
274273
}
275-
otherPlatforms := lo.Filter(nix.SupportedPlatforms(), func(p string, _ int) bool {
276-
return p != strings.TrimSpace(platform)
277-
})
278274
return usererr.New(
279275
"package %s cannot be installed on your platform%s. "+
280-
"Consider using `--platform` or `--exclude-platform` with `devbox add` to install on a supported"+
281-
" platform. Other available platforms are: %s.",
282-
input.String(),
276+
"Run `devbox add %[1]s --exclude-platform%[2]s` and re-try.",
277+
input.Raw,
283278
platform,
284-
strings.Join(otherPlatforms, ", "),
285279
)
286280
}
287281
}

0 commit comments

Comments
 (0)