diff --git a/build.go b/build.go index 4dad9a6..518efb6 100644 --- a/build.go +++ b/build.go @@ -41,7 +41,7 @@ func commonJSImports(conf *config.Config, c *code, tsFilename string) { os.Exit(1) } - c.l("import * as " + importMapping.TypeScriptModule + " from '" + relativePath + "'; // " + tsFilename + " to " + importMapping.Out) + c.l("import * as " + importMapping.TypeScriptModule + " from './" + relativePath + "'; // " + tsFilename + " to " + importMapping.Out) } } diff --git a/cmd/gotsrpc/gotsrpc.go b/cmd/gotsrpc/gotsrpc.go index 3bf7f6c..a3f4121 100644 --- a/cmd/gotsrpc/gotsrpc.go +++ b/cmd/gotsrpc/gotsrpc.go @@ -40,7 +40,7 @@ func main() { conf, err := config.LoadConfigFile(args[0]) if err != nil { - fmt.Fprintln(os.Stderr, "config load error, could not load config from", args[0]) + fmt.Fprintln(os.Stderr, "config load error, could not load config from", args[0], ":", err) os.Exit(2) } gotsrpc.Build(conf, goPath) diff --git a/config/config.go b/config/config.go index 9ec1dc7..e1b2ee1 100644 --- a/config/config.go +++ b/config/config.go @@ -39,7 +39,7 @@ type Config struct { func LoadConfigFile(file string) (conf *Config, err error) { yamlBytes, readErr := ioutil.ReadFile(file) if readErr != nil { - err = readErr + err = errors.New("could not read config file: " + readErr.Error()) return } return loadConfig(yamlBytes) @@ -49,7 +49,7 @@ func loadConfig(yamlBytes []byte) (conf *Config, err error) { conf = &Config{} yamlErr := yaml.Unmarshal(yamlBytes, conf) if yamlErr != nil { - err = yamlErr + err = errors.New("could not parse yaml: " + yamlErr.Error()) return } switch conf.ModuleKind {