Skip to content

Commit

Permalink
Merge pull request #84 from tryy3/master
Browse files Browse the repository at this point in the history
Small fixes for windows
  • Loading branch information
matthewmueller authored Dec 19, 2017
2 parents 1bc32bd + 01cd062 commit b6bb4e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/mains/mains.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ func Find(packages ...string) (mains []string, err error) {

for i, pkg := range packages {
// no prefix
if pkg[0] != '.' && pkg[0] != filepath.Separator {
if pkg[0] != '.' && !filepath.IsAbs(pkg) {
packages[i] = "." + string(filepath.Separator) + pkg
continue
}

// absolute
if pkg[0] == filepath.Separator {
if filepath.IsAbs(pkg) {
rel, err := filepath.Rel(cwd, pkg)
if err != nil {
return mains, errors.Wrapf(err, "unable to get relative path")
Expand Down Expand Up @@ -84,7 +84,7 @@ func Find(packages ...string) (mains []string, err error) {
if parts[1] == "command-line-arguments" {
// TODO: i don't think this will work for multiple files
for _, pkg := range packages {
results = append(results, path.Join(cwd, path.Dir(pkg)))
results = append(results, path.Join(cwd, filepath.Dir(pkg)))
}
continue
}
Expand Down

0 comments on commit b6bb4e1

Please sign in to comment.