Skip to content

Commit

Permalink
add a way to get a cmd mutation by its key
Browse files Browse the repository at this point in the history
  • Loading branch information
Racer159 committed May 20, 2024
1 parent c4f1bcd commit 19bd4fe
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions exec/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ func RegisterCmdMutation(cmdKey string, cmdLocation string) {
registeredCmdMutations[fmt.Sprintf("./%s ", cmdKey)] = fmt.Sprintf("%s ", cmdLocation)
}

// GetCmdMutation returns the cmdLocation for a given cmdKey and whether that key exists
func GetCmdMutation(cmdKey string) (string, bool) {
cmdLocation, ok := registeredCmdMutations[cmdKey]
return cmdLocation, ok
}

// MutateCommand performs some basic string mutations to make commands more useful.
func MutateCommand(cmd string, shellPref Shell) string {
return mutateCommandForOS(cmd, shellPref, runtime.GOOS)
Expand Down

0 comments on commit 19bd4fe

Please sign in to comment.