Skip to content

Commit

Permalink
fix import path bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryan Matsuo committed Jun 22, 2013
1 parent 6f5d46c commit eb571d7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
6 changes: 0 additions & 6 deletions gonew_main.go
Expand Up @@ -163,12 +163,6 @@ func parseOptions() *options {
}
if opts.pkg == "" {
opts.pkg = opts.target
if strings.HasPrefix(opts.pkg, "go-") {
opts.pkg = opts.pkg[3:]
}
if strings.HasSuffix(opts.pkg, ".go") {
opts.pkg = opts.pkg[:len(opts.pkg)-3]
}
}

return opts
Expand Down
19 changes: 14 additions & 5 deletions project/project.go
Expand Up @@ -7,11 +7,12 @@ package project
/* Filename: project.go
* Author: Bryan Matsuo <bryan.matsuo [at] gmail.com>
* Created: 2012-07-06 23:08:16.03525 -0700 PDT
* Description:
* Description:
*/

import (
"path"
"strings"

"github.com/bmatsuo/gonew/config"
"github.com/bmatsuo/gonew/extension"
Expand Down Expand Up @@ -58,8 +59,16 @@ type project struct {
env *config.Environment
}

func (p *project) Name() string { return p.name }
func (p *project) Prefix() string { return "./" + p.name } // XXX could be smarter
func (p *project) Package() string { return p.pkg }
func (p *project) Import() string { return importPath(p.Package()) }
func (p *project) Name() string { return p.name }
func (p *project) Prefix() string { return "./" + p.name } // XXX could be smarter
func (p *project) Package() string {
if strings.HasPrefix(p.pkg, "go-") {
return p.pkg[3:]
}
if strings.HasSuffix(p.pkg, ".go") {
return p.pkg[:len(p.pkg)-3]
}
return p.pkg
}
func (p *project) Import() string { return importPath(p.pkg) }
func (p *project) Env() *config.Environment { return p.env }

0 comments on commit eb571d7

Please sign in to comment.