Skip to content

Commit

Permalink
🐛 provider install: create system path if home path does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
vjeffrey committed Sep 21, 2023
1 parent 8e36364 commit b9cc94e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions providers/providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ func ListAll() ([]*Provider, error) {
}

if sysOk {
log.Debug().Msg("looking for providers in system path")
cur, err := findProviders(SystemPath)
if err != nil {
log.Warn().Str("path", SystemPath).Err(err).Msg("failed to get providers from system path")
Expand All @@ -112,6 +113,7 @@ func ListAll() ([]*Provider, error) {
}

if homeOk {
log.Debug().Msg("looking for providers in home path")
cur, err := findProviders(HomePath)
if err != nil {
log.Warn().Str("path", HomePath).Err(err).Msg("failed to get providers from home path")
Expand Down Expand Up @@ -303,6 +305,9 @@ func InstallIO(reader io.ReadCloser, conf InstallConf) ([]*Provider, error) {
if conf.Dst == "" {
conf.Dst = HomePath
}
if conf.Dst == "" {
conf.Dst = SystemPath
}

if !config.ProbeDir(conf.Dst) {
log.Debug().Str("path", conf.Dst).Msg("creating providers directory")
Expand Down

0 comments on commit b9cc94e

Please sign in to comment.