diff --git a/pkg/config/config.go b/pkg/config/config.go index ecbd940c7..c861bef04 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -151,7 +151,14 @@ type Config struct { // Environ returns the config as a list of environment variables. func (c *Config) Environ() []string { - envs := []string{} + ex, err := os.Executable() + if err != nil { + ex = "soft-serve" + } + ex = filepath.ToSlash(ex) + envs := []string{ + fmt.Sprintf("SOFT_SERVE_EXE_PATH=%s", ex), + } if c == nil { return envs } diff --git a/pkg/hooks/gen.go b/pkg/hooks/gen.go index 467b2f263..6c4ceba1c 100644 --- a/pkg/hooks/gen.go +++ b/pkg/hooks/gen.go @@ -78,7 +78,7 @@ func GenerateHooks(_ context.Context, cfg *config.Config, repo string) error { Hook string Args string }{ - Executable: ex, + Executable: "\"${SOFT_SERVE_EXE_PATH}\"", Hook: hook, Args: args, }); err != nil {