Skip to content

Commit

Permalink
fix(upload): Get custom project titles from 'project' configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
elldritch committed May 17, 2018
1 parent e37d325 commit 41d8e4d
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions cmd/fossa/cmd/upload/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"io/ioutil"
"net/url"
"os"
"path/filepath"
"strings"

"github.com/pkg/errors"
Expand Down Expand Up @@ -125,14 +124,8 @@ func Do(c config.CLIConfig, data []fossa.SourceUnit) (fossa.Locator, error) {
}

title := data[0].Name
if c.Fetcher == "custom" {
cwd, err := filepath.Abs(".")
if err != nil {
log.Logger.Fatalf("Could not get working directory: %s", err.Error())
}
if cwd != "" {
title = filepath.Base(cwd)
}
if c.Fetcher == "custom" && title == "" {
title = c.Project
}

return fossa.Upload(c.Fetcher, c.Project, c.Revision, title, data)
Expand Down

0 comments on commit 41d8e4d

Please sign in to comment.