From 948bbfbae49492cd825646c3991457ccc767a016 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 20 Mar 2014 14:32:59 -0400 Subject: [PATCH] Mirror fix --- cmd/cmd.go | 3 ++- cmd/gen.go | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/cmd.go b/cmd/cmd.go index 8a2d5d24a..279bb84d3 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -83,5 +83,6 @@ func versionSuffix(value string) string { } func isSubpackage(rootPath, targetPath string) bool { - return strings.HasSuffix(workDir, rootPath) || strings.HasPrefix(rootPath, targetPath) + return strings.HasSuffix(strings.Replace(workDir, "\\", "/", -1), rootPath) || + strings.HasPrefix(rootPath, targetPath) } diff --git a/cmd/gen.go b/cmd/gen.go index 3b31516d4..5e067b7a8 100644 --- a/cmd/gen.go +++ b/cmd/gen.go @@ -62,8 +62,7 @@ func runGen(ctx *cli.Context) { for _, p := range imports { p = doc.GetProjectPath(p) // Skip subpackage(s) of current project. - if strings.HasSuffix(strings.Replace(workDir, "\\", "/", -1), p) || - strings.HasPrefix(p, targetPath) { + if isSubpackage(p, targetPath) { continue }