Skip to content

Commit

Permalink
Merge pull request #142 from planetscale/iheanyi/fix-org-show-for-git…
Browse files Browse the repository at this point in the history
…hub-repo

Fix org show command
  • Loading branch information
iheanyi authored Apr 1, 2021
2 parents 224ea5f + 251ee00 commit 5e66f90
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/cmd/org/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func ShowCmd(cfg *config.Config) *cobra.Command {
return errors.New("config file exists, but organization is not set")
}

fmt.Printf("%s (from file: %s)", cmdutil.Bold(cfg.Organization), configFile)
fmt.Printf("%s (from file: %s)\n", cmdutil.Bold(cfg.Organization), configFile)

return nil
},
Expand Down
6 changes: 3 additions & 3 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ func AccessTokenPath() (string, error) {
// repository.
func ProjectConfigPath() (string, error) {
basePath, err := RootGitRepoDir()
if err != nil {
return "", err
if err == nil {
return path.Join(basePath, projectConfigName), nil
}
return path.Join(basePath, projectConfigName), nil
return path.Join("", projectConfigName), nil
}

func RootGitRepoDir() (string, error) {
Expand Down
4 changes: 2 additions & 2 deletions internal/config/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ func NewFileConfig(path string) (*FileConfig, error) {
return nil, err
}

var cfg *FileConfig
var cfg FileConfig
err = yaml.Unmarshal(out, &cfg)
if err != nil {
return nil, fmt.Errorf("can't unmarshal file %q: %s", path, err)
}

return cfg, nil
return &cfg, nil
}

// DefaultConfig returns the file config from the default config path.
Expand Down

0 comments on commit 5e66f90

Please sign in to comment.