MCPcopy Index your code
hub / github.com/jetify-com/devbox / Command

Method Command

nix/command.go:53–68  ·  view source on GitHub ↗

Command creates an arbitrary Nix command that uses the Path, ExtraArgs, Logger and other defaults from n.

(args ...any)

Source from the content-addressed store, hash-verified

51// Command creates an arbitrary Nix command that uses the Path, ExtraArgs,
52// Logger and other defaults from n.
53func (n *Nix) Command(args ...any) *Cmd {
54 cmd := &Cmd{
55 Args: make(Args, 1, 1+len(n.ExtraArgs)+len(args)),
56 Logger: n.logger(),
57 }
58 cmd.Path, cmd.err = n.resolvePath()
59
60 if n.Path == "" {
61 cmd.Args[0] = "nix" // resolved from $PATH
62 } else {
63 cmd.Args[0] = n.Path // explicitly set
64 }
65 cmd.Args = append(cmd.Args, n.ExtraArgs...)
66 cmd.Args = append(cmd.Args, args...)
67 return cmd
68}
69
70func (c *Cmd) CombinedOutput(ctx context.Context) ([]byte, error) {
71 defer c.logRunFunc(ctx)()

Callers 15

InfoMethod · 0.95
CommandFunction · 0.80
generateTestscriptFunction · 0.80
walkExampleDirFunction · 0.80
RunScriptFunction · 0.80
CommandTTYFunction · 0.80
CommandTTYWithBufferFunction · 0.80
cloneAndReadMethod · 0.80
setupLocalGitRepoFunction · 0.80
StopFunction · 0.80
ExtractFunction · 0.80

Calls 2

loggerMethod · 0.95
resolvePathMethod · 0.95

Tested by 2

setupLocalGitRepoFunction · 0.64