File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,11 @@ var ProjectRoot string
1111
1212func init () {
1313 if ProjectRoot == "" {
14- fmt .Fprintf (os .Stderr , "ProjectRoot is not set\n " )
15- return
14+ panic ("ProjectRoot is not set, compile with -ldflags '-X github.com/cpunion/go-python.ProjectRoot=/path/to/project/.deps'" )
1615 }
1716 envs , err := env .ReadEnv (ProjectRoot )
1817 if err != nil {
19- fmt .Fprintf (os .Stderr , "Failed to read env: %s\n " , err )
20- return
18+ panic (fmt .Sprintf ("Failed to read env: %s" , err ))
2119 }
2220 for key , value := range envs {
2321 os .Setenv (key , value )
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ func ReadEnvFile(projectDir string) (map[string]string, error) {
133133 envFile := GetEnvConfigPath (projectDir )
134134 content , err := os .ReadFile (envFile )
135135 if err != nil {
136- return nil , fmt .Errorf ("failed to read env file: %v" , err )
136+ return nil , fmt .Errorf ("failed to read env file %s : %v" , envFile , err )
137137 }
138138 envs := map [string ]string {}
139139 for _ , line := range strings .Split (strings .TrimSpace (string (content )), "\n " ) {
You can’t perform that action at this time.
0 commit comments