Skip to content

Commit

Permalink
Merge pull request #366 from reubenmiller/feat-set-session-ignore-ext…
Browse files Browse the repository at this point in the history
…ensions

feat(set-session): ignore extensions folder when scanning for available sessions
  • Loading branch information
reubenmiller authored Apr 28, 2024
2 parents d20d952 + 29d05c4 commit 2821517
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/cmd/sessions/selectsession/selectsession.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,17 @@ func SelectSession(io *iostreams.IOStreams, cfg *config.Config, log *logger.Logg
log.Printf("Ignoring dir: %+v", info.Name())
return filepath.SkipDir
}

if info.IsDir() && path == cfg.ExtensionsDataDir() {
log.Printf("Ignoring extensions dir: %+v", info.Name())
return filepath.SkipDir
}
// extensions is a reserved word (in case the user has older extensions folder which is not the current setting, but left overs from a previous location)
if info.IsDir() && strings.EqualFold(info.Name(), "extensions") {
log.Printf("Ignoring reserved dir names: %+v", info.Name())
return filepath.SkipDir
}

if info.IsDir() {
return nil
}
Expand Down

0 comments on commit 2821517

Please sign in to comment.