-
Notifications
You must be signed in to change notification settings - Fork 31
fix: unquote environment variable passed to hook commands #410
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
base: main
Are you sure you want to change the base?
Changes from all commits
5bd98a8
5b2cf70
cc1ce45
228907d
d942d79
5122e45
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,7 +30,6 @@ import ( | |
| "github.com/gorilla/websocket" | ||
| "github.com/radovskyb/watcher" | ||
| "github.com/slackapi/slack-cli/internal/config" | ||
| "github.com/slackapi/slack-cli/internal/goutils" | ||
| "github.com/slackapi/slack-cli/internal/hooks" | ||
| "github.com/slackapi/slack-cli/internal/iostreams" | ||
| "github.com/slackapi/slack-cli/internal/pkg/apps" | ||
|
|
@@ -307,7 +306,9 @@ func (r *LocalServer) StartDelegate(ctx context.Context) error { | |
| // To avoid removing any environment variables that are set in the current environment, we first set the cmd.Env to the current environment. | ||
| // before adding any new environment variables. | ||
| var cmdEnvVars = os.Environ() | ||
| cmdEnvVars = append(cmdEnvVars, goutils.MapToStringSlice(sdkManagedConnectionStartHookOpts.Env, "")...) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🏁 note: I understand the 🏆 ramble: This implementation in |
||
| for name, value := range sdkManagedConnectionStartHookOpts.Env { | ||
| cmdEnvVars = append(cmdEnvVars, name+"="+value) | ||
| } | ||
| cmd := sdkManagedConnectionStartHookOpts.Exec.Command(cmdEnvVars, os.Stdout, os.Stderr, nil, cmdArgs[0], cmdArgVars...) | ||
|
|
||
| // Store command reference for lifecycle management | ||
|
|
||
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.
🔭 note: These values are set for both the default and message-boundaries protocols:
slack-cli/internal/hooks/hook_executor_default.go
Line 70 in 8056444
slack-cli/internal/hooks/hook_executor_v2.go
Line 87 in 8056444
slack-cli/internal/hooks/shell.go
Lines 56 to 59 in 8056444