Skip to content

Commit bf49c9b

Browse files
committedNov 1, 2019
fix(builder): Add AppRegistry org to ToOption
1 parent 17dd631 commit bf49c9b

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed
 

‎pkg/appregistry/builder_options.go

+19-8
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,21 @@ func (o *AppregistryBuildOptions) Complete() error {
5656

5757
// build a separate path for manifests and the built database, so that
5858
// building is idempotent
59-
manifestDir, err := ioutil.TempDir("", "manifests-")
60-
if err != nil {
61-
return err
59+
if o.ManifestDir == "" {
60+
manifestDir, err := ioutil.TempDir("", "manifests-")
61+
if err != nil {
62+
return err
63+
}
64+
o.ManifestDir = manifestDir
6265
}
63-
o.ManifestDir = manifestDir
64-
databaseDir, err := ioutil.TempDir("", "db-")
65-
if err != nil {
66-
return err
66+
67+
if o.DatabaseDir == "" {
68+
databaseDir, err := ioutil.TempDir("", "db-")
69+
if err != nil {
70+
return err
71+
}
72+
o.DatabaseDir = databaseDir
6773
}
68-
o.DatabaseDir = databaseDir
6974

7075
if o.DatabasePath == "" {
7176
o.DatabasePath = path.Join(o.DatabaseDir, "bundles.db")
@@ -96,6 +101,9 @@ func (c *AppregistryBuildOptions) ToOption() AppregistryBuildOption {
96101
if c.AuthToken != "" {
97102
o.AuthToken = c.AuthToken
98103
}
104+
if c.AppRegistryOrg != "" {
105+
o.AppRegistryOrg = c.AppRegistryOrg
106+
}
99107
if c.AppRegistryEndpoint != "" {
100108
o.AppRegistryEndpoint = c.AppRegistryEndpoint
101109
}
@@ -105,6 +113,9 @@ func (c *AppregistryBuildOptions) ToOption() AppregistryBuildOption {
105113
if c.CacheDir != "" {
106114
o.CacheDir = c.CacheDir
107115
}
116+
if c.DatabaseDir != "" {
117+
o.DatabaseDir = c.DatabaseDir
118+
}
108119
}
109120
}
110121

0 commit comments

Comments
 (0)
Please sign in to comment.