Skip to content

Commit

Permalink
feat: Show a message when using a local registry (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
cszatmary authored Apr 1, 2020
1 parent 88c7dd3 commit 16e9855
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 0 additions & 5 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ func init() {
fatal.ExitErr(err, "Failed to load tbrc.")
}

if config.IsExperimentalEnabled() {
log.Infoln(color.Yellow("🚧 Experimental mode enabled 🚧"))
log.Infoln(color.Yellow("If you find any bugs please report them in an issue: https://github.com/TouchBistro/tb/issues"))
}

checkVersion()
})
}
Expand Down
9 changes: 9 additions & 0 deletions config/tbrc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"path/filepath"
"strings"

"github.com/TouchBistro/goutils/color"
"github.com/TouchBistro/goutils/fatal"
"github.com/TouchBistro/goutils/file"
"github.com/TouchBistro/tb/playlist"
Expand Down Expand Up @@ -71,12 +72,20 @@ func LoadTBRC() error {
DisableTimestamp: true,
})

if IsExperimentalEnabled() {
log.Infoln(color.Yellow("🚧 Experimental mode enabled 🚧"))
log.Infoln(color.Yellow("If you find any bugs please report them in an issue: https://github.com/TouchBistro/tb/issues"))
}

// Resolve registry paths
for i, r := range tbrc.Registries {
isLocal := r.LocalPath != ""

// Set true path for usage later
if isLocal {
// Remind people they are using a local version in case they forgot
log.Infof("❗ Using a local version of the %s registry ❗", color.Cyan(r.Name))

// Local paths can be prefixed with ~ for convenience
if strings.HasPrefix(r.LocalPath, "~") {
r.Path = filepath.Join(os.Getenv("HOME"), strings.TrimPrefix(r.LocalPath, "~"))
Expand Down

0 comments on commit 16e9855

Please sign in to comment.