You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add nix package manager detector and error if not installed (#2641)
## Summary
Check if nix package manager is installed before calling nix
## How was it tested?
`go build -o devbox cmd/devbox/main.go`
`devbox shell`
## Is this change backwards-compatible?
Yes
Copy file name to clipboardExpand all lines: nix/nix.go
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,18 @@ package nix
6
6
import (
7
7
"bytes"
8
8
"encoding/json"
9
+
"errors"
9
10
"fmt"
10
11
"os"
11
12
"os/exec"
12
13
"strings"
13
14
)
14
15
15
16
funcShell(pathstring) error {
17
+
_, err:=exec.LookPath("nix-shell")
18
+
iferr!=nil {
19
+
returnerrors.New("Could not find nix in your PATH\nInstall nix by following the instructions at https://nixos.org/download.html and make sure you've set up your PATH correctly.")
0 commit comments