File tree Expand file tree Collapse file tree 3 files changed +15
-11
lines changed Expand file tree Collapse file tree 3 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import (
1414
1515 "github.com/pkg/errors"
1616 "github.com/samber/lo"
17+ "github.com/samber/lo/mutable"
1718 "go.jetify.com/devbox/internal/build"
1819 "go.jetify.com/devbox/internal/cachehash"
1920 "go.jetify.com/devbox/internal/devbox/shellcmd"
@@ -333,10 +334,14 @@ func (c *Config) Packages(
333334 }
334335
335336 // Keep only the last occurrence of each package (by name).
336- return lo .Reverse (lo .UniqBy (
337- lo .Reverse (packages ),
337+ mutable .Reverse (packages )
338+ packages = lo .UniqBy (
339+ packages ,
338340 func (p configfile.Package ) string { return p .Name },
339- ))
341+ )
342+ mutable .Reverse (packages )
343+
344+ return packages
340345}
341346
342347func (c * Config ) NixPkgsCommitHash () string {
Original file line number Diff line number Diff line change @@ -15,18 +15,17 @@ import (
1515 "go.jetify.com/devbox/internal/boxcli"
1616)
1717
18- func Main (m * testing.M ) int {
19- commands := map [string ]func () int {
20- "devbox" : func () int {
18+ func Main (m * testing.M ) {
19+ commands := map [string ]func (){
20+ "devbox" : func () {
2121 // Call the devbox CLI directly:
22- return boxcli .Execute (context .Background (), os .Args [1 :])
22+ boxcli .Execute (context .Background (), os .Args [1 :])
2323 },
24- "print" : func () int { // Not 'echo' because we don't expand variables
24+ "print" : func () { // Not 'echo' because we don't expand variables
2525 fmt .Println (strings .Join (os .Args [1 :], " " ))
26- return 0
2726 },
2827 }
29- return testscript .RunMain (m , commands )
28+ testscript .Main (m , commands )
3029}
3130
3231func RunTestscripts (t * testing.T , testscriptsDir string ) {
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ func TestScripts(t *testing.T) {
1919}
2020
2121func TestMain (m * testing.M ) {
22- os . Exit ( testrunner .Main (m ) )
22+ testrunner .Main (m )
2323}
2424
2525// TestExamples runs testscripts on the devbox-projects in the examples folder.
You can’t perform that action at this time.
0 commit comments