MCPcopy Index your code
hub / github.com/devspace-sh/devspace / executePluginHookAt

Function executePluginHookAt

pkg/devspace/plugin/hook.go:243–259  ·  view source on GitHub ↗
(plugin Metadata, event string, env map[string]string)

Source from the content-addressed store, hash-verified

241}
242
243func executePluginHookAt(plugin Metadata, event string, env map[string]string) error {
244 pluginFolder := plugin.PluginFolder
245 for _, pluginHook := range plugin.Hooks {
246 if strings.TrimSpace(pluginHook.Event) == event {
247 var err error
248 if pluginHook.Background {
249 err = CallPluginExecutableInBackground(filepath.Join(pluginFolder, PluginBinary), pluginHook.BaseArgs, env)
250 } else {
251 err = CallPluginExecutable(filepath.Join(pluginFolder, PluginBinary), pluginHook.BaseArgs, env, os.Stdout)
252 }
253 if err != nil {
254 return fmt.Errorf("error calling plugin hook %s at event %s: %v", plugin.Name, event, err)
255 }
256 }
257 }
258 return nil
259}
260
261func CallPluginExecutableInBackground(main string, argv []string, extraEnvVars map[string]string) error {
262 env := os.Environ()

Callers 2

ExecutePluginHookAtFunction · 0.85

Calls 3

CallPluginExecutableFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected