Skip to content

Commit 80c12e0

Browse files
authored
[services] Fix process-compose not being installed (#1323)
## Summary On new devbox/nix installations, nix is not in PATH. For most commands, we add nix to path (add, shell, run, etc), but not for services. Longer term, we probably don't want this if we want to support non-nix package services. ## How was it tested? In fresh docker ubuntu, ran: ```bash devbox init devbox services ls devbox add apache devbox services up ```
1 parent 3d91344 commit 80c12e0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

internal/boxcli/services.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ func servicesCmd() *cobra.Command {
4545
serviceUpFlags := serviceUpFlags{}
4646
serviceStopFlags := serviceStopFlags{}
4747
servicesCommand := &cobra.Command{
48-
Use: "services",
49-
Short: "Interact with devbox services",
48+
Use: "services",
49+
Short: "Interact with devbox services",
50+
PersistentPreRunE: ensureNixInstalled,
5051
}
5152

5253
lsCommand := &cobra.Command{

internal/devpkg/package.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,10 @@ func (p *Package) normalizePackageAttributePath() (string, error) {
281281

282282
// We prefer search over just trying to parse the URL because search will
283283
// guarantee that the package exists for the current system.
284-
infos, _ := nix.Search(query)
284+
infos, err := nix.Search(query)
285+
if err != nil {
286+
return "", err
287+
}
285288

286289
if len(infos) == 1 {
287290
return lo.Keys(infos)[0], nil

0 commit comments

Comments
 (0)