Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
hirenko-v committed Sep 26, 2024
1 parent e01f0e3 commit c57727e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/snippet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func (SnippetExecutor) Execute(_ context.Context, in executor.ExecuteInput) (exe
}

// Step 1: Execute the command
content, err := exec.Command("sh", "-c", fmt.Sprintf("echo %s", value)).Output()
content, err := exec.Command("sh", "-c", value).Output()
if err != nil {
return executor.ExecuteOutput{}, errors.New(fmt.Sprintf("Failed to run command, %s", err))
}
Expand Down Expand Up @@ -251,8 +251,8 @@ func (SnippetExecutor) Help(context.Context) (api.Message, error) {
func parseCommand(cmd string) (action, value string) {
parts := strings.Fields(cmd)
if len(parts) > 1 {
action = parts[1]
value = strings.Join(parts[2:], " ")
action = parts[0]
value = strings.Join(parts[1:], " ")
}
return
}
Expand Down

0 comments on commit c57727e

Please sign in to comment.