Skip to content

Commit 41d8e4d

Browse files
committed
fix(upload): Get custom project titles from 'project' configuration
1 parent e37d325 commit 41d8e4d

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

cmd/fossa/cmd/upload/upload.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"io/ioutil"
66
"net/url"
77
"os"
8-
"path/filepath"
98
"strings"
109

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

127126
title := data[0].Name
128-
if c.Fetcher == "custom" {
129-
cwd, err := filepath.Abs(".")
130-
if err != nil {
131-
log.Logger.Fatalf("Could not get working directory: %s", err.Error())
132-
}
133-
if cwd != "" {
134-
title = filepath.Base(cwd)
135-
}
127+
if c.Fetcher == "custom" && title == "" {
128+
title = c.Project
136129
}
137130

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

0 commit comments

Comments
 (0)