File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -10,13 +10,24 @@ import (
1010var ProjectRoot string
1111
1212func init () {
13+ injectDebug := os .Getenv ("GP_INJECT_DEBUG" )
1314 if ProjectRoot == "" {
14- panic ("ProjectRoot is not set, compile with -ldflags '-X github.com/cpunion/go-python.ProjectRoot=/path/to/project/.deps'" )
15+ if injectDebug != "" {
16+ panic ("ProjectRoot is not set, compile with -ldflags '-X github.com/cpunion/go-python.ProjectRoot=/path/to/project'" )
17+ }
18+ return
1519 }
1620 envs , err := env .ReadEnv (ProjectRoot )
1721 if err != nil {
1822 panic (fmt .Sprintf ("Failed to read env: %s" , err ))
1923 }
24+ if injectDebug != "" {
25+ fmt .Fprintf (os .Stderr , "Injecting envs for project: %s\n " , ProjectRoot )
26+ for key , value := range envs {
27+ fmt .Fprintf (os .Stderr , " %s=%s\n " , key , value )
28+ }
29+ fmt .Fprintf (os .Stderr , "End of envs\n " )
30+ }
2031 for key , value := range envs {
2132 os .Setenv (key , value )
2233 }
You can’t perform that action at this time.
0 commit comments