@@ -52,13 +52,14 @@ const (
52
52
)
53
53
54
54
type Devbox struct {
55
- cfg * devconfig.Config
56
- lockfile * lock.File
57
- nix nix.Nixer
58
- projectDir string
59
- pluginManager * plugin.Manager
60
- pure bool
61
- allowInsecureAdds bool
55
+ cfg * devconfig.Config
56
+ lockfile * lock.File
57
+ nix nix.Nixer
58
+ projectDir string
59
+ pluginManager * plugin.Manager
60
+ pure bool
61
+ allowInsecureAdds bool
62
+ customProcessComposeFile string
62
63
63
64
// Possible TODO: hardcode this to stderr. Allowing the caller to specify the
64
65
// writer is error prone. Since it is almost always stderr, we should default
@@ -82,13 +83,14 @@ func Open(opts *devopt.Opts) (*Devbox, error) {
82
83
}
83
84
84
85
box := & Devbox {
85
- cfg : cfg ,
86
- nix : & nix.Nix {},
87
- projectDir : projectDir ,
88
- pluginManager : plugin .NewManager (),
89
- writer : opts .Writer ,
90
- pure : opts .Pure ,
91
- allowInsecureAdds : opts .AllowInsecureAdds ,
86
+ cfg : cfg ,
87
+ nix : & nix.Nix {},
88
+ projectDir : projectDir ,
89
+ pluginManager : plugin .NewManager (),
90
+ writer : opts .Writer ,
91
+ pure : opts .Pure ,
92
+ customProcessComposeFile : opts .CustomProcessComposeFile ,
93
+ allowInsecureAdds : opts .AllowInsecureAdds ,
92
94
}
93
95
94
96
lock , err := lock .GetFile (box )
@@ -487,7 +489,7 @@ func (d *Devbox) Services() (services.Services, error) {
487
489
return nil , err
488
490
}
489
491
490
- userSvcs := services .FromUserProcessCompose (d .projectDir )
492
+ userSvcs := services .FromUserProcessCompose (d .projectDir , d . customProcessComposeFile )
491
493
492
494
svcSet := lo .Assign (pluginSvcs , userSvcs )
493
495
keys := make ([]string , 0 , len (svcSet ))
@@ -656,6 +658,19 @@ func (d *Devbox) StartProcessManager(
656
658
background bool ,
657
659
processComposeFileOrDir string ,
658
660
) error {
661
+
662
+ if ! d .IsEnvEnabled () {
663
+ args := []string {"services" , "up" }
664
+ args = append (args , requestedServices ... )
665
+ if processComposeFileOrDir != "" {
666
+ args = append (args , "--process-compose-file" , processComposeFileOrDir )
667
+ }
668
+ if background {
669
+ args = append (args , "--background" )
670
+ }
671
+ return d .RunScript (ctx , "devbox" , args )
672
+ }
673
+
659
674
svcs , err := d .Services ()
660
675
if err != nil {
661
676
return err
@@ -685,17 +700,6 @@ func (d *Devbox) StartProcessManager(
685
700
return err
686
701
}
687
702
}
688
- if ! d .IsEnvEnabled () {
689
- args := []string {"services" , "up" }
690
- args = append (args , requestedServices ... )
691
- if processComposeFileOrDir != "" {
692
- args = append (args , "--process-compose-file" , processComposeFileOrDir )
693
- }
694
- if background {
695
- args = append (args , "--background" )
696
- }
697
- return d .RunScript (ctx , "devbox" , args )
698
- }
699
703
700
704
// Start the process manager
701
705
@@ -705,7 +709,7 @@ func (d *Devbox) StartProcessManager(
705
709
requestedServices ,
706
710
svcs ,
707
711
d .projectDir ,
708
- processComposePath , processComposeFileOrDir ,
712
+ processComposePath ,
709
713
background ,
710
714
)
711
715
}
0 commit comments