-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lockfile and manifest update specific settings (#9)
- Loading branch information
1 parent
724e979
commit 68f4540
Showing
9 changed files
with
98 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package config | ||
|
||
type LockfileUpdates struct { | ||
Enabled *bool `mapstructure:"enabled,omitempty" yaml:"enabled,omitempty" json:"enabled,omitempty"` | ||
Enabled *bool `mapstructure:"enabled,omitempty" yaml:"enabled,omitempty" json:"enabled,omitempty"` | ||
Settings Settings `mapstructure:"settings,omitempty" yaml:"settings,omitempty" json:"settings"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package config | ||
|
||
import ( | ||
"strings" | ||
|
||
"github.com/dropseed/deps/internal/env" | ||
) | ||
|
||
type Settings map[string]interface{} | ||
|
||
func (s Settings) Get(name string) interface{} { | ||
for k, v := range s { | ||
if strings.ToLower(k) == strings.ToLower(name) { | ||
return v | ||
} | ||
} | ||
|
||
return nil | ||
} | ||
|
||
func (s Settings) AsEnviron() []string { | ||
environ := []string{} | ||
|
||
for k, v := range s { | ||
environString, err := env.SettingToEnviron(k, v) | ||
if err != nil { | ||
panic(err) | ||
} | ||
environ = append(environ, environString) | ||
} | ||
|
||
return environ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters