Skip to content

Commit c15183c

Browse files
committed
simplify error message
1 parent d9e54f0 commit c15183c

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
@@ -182,10 +182,6 @@ var nixPlatforms = []string{
182182
"armv7l-linux",
183183
}
184184

185-
func SupportedPlatforms() []string {
186-
return nixPlatforms
187-
}
188-
189185
// EnsureValidPlatform returns an error if the platform is not supported by nix.
190186
// https://nixos.org/manual/nix/stable/installation/supported-platforms.html
191187
func EnsureValidPlatform(platform 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)