feat: add a post-registry-login trigger
This allows other plugins to execute commands after a registry has been authenticated against.
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
||||
type PlugnTriggerInput struct {
|
||||
Args []string
|
||||
CaptureOutput bool
|
||||
Env map[string]string
|
||||
StreamStdio bool
|
||||
Trigger string
|
||||
}
|
||||
@@ -42,6 +43,11 @@ func CallPlugnTrigger(input PlugnTriggerInput) (execute.ExecResult, error) {
|
||||
if isatty && !input.CaptureOutput {
|
||||
env = append(env, "FORCE_TTY=1")
|
||||
}
|
||||
if input.Env != nil {
|
||||
for k, v := range input.Env {
|
||||
env = append(env, fmt.Sprintf("%s=%s", k, v))
|
||||
}
|
||||
}
|
||||
|
||||
args := []string{"trigger", input.Trigger}
|
||||
args = append(args, input.Args...)
|
||||
|
||||
Reference in New Issue
Block a user