-
Notifications
You must be signed in to change notification settings - Fork 263
devbox run can run arbitrary commands #493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
if script == "" || !slices.Contains(scripts, script) { | ||
return errors.Errorf("no script found with name \"%s\". "+ | ||
"Here's a list of the existing scripts in devbox.json: %v", script, scripts) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when a user has a script in their devbox.json named "ls" and they run devbox run ls
?
Does the script alias take precedent over the command ls
? or vice versa?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script takes precedence
internal/nix/run.go
Outdated
return errors.New("attempted to run script but did not specify script name") | ||
func RunScript(nixShellFilePath string, projectDir string, cmdWithArgs string, additionalEnv []string) error { | ||
if cmdWithArgs == "" { | ||
return errors.New("attempted to run a command but gave an empty command") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it can be both a command or a script right? so can we say "attempted to run a command or a script but gave an empty one?" or something like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I was assuming that a "command" can be a script, but I can change the wording to make it clearer.
PTAL |
3620865
to
21d07d9
Compare
Summary
TSIA
How was it tested?