Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/2.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmccallister committed Mar 2, 2021
2 parents d23a7bc + a162ea4 commit ce296c1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Release Notes for Craft Nitro

## 2.0.2 - 2021-03-02

### Fixed
- Fixed a bug that could occur when running `nitro add` before `nitro init`.

## 2.0.1 - 2021-03-02

### Fixed
Expand Down
5 changes: 5 additions & 0 deletions command/initialize/initialize.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package initialize

import (
"context"
"errors"
"fmt"
"strings"
Expand Down Expand Up @@ -39,6 +40,10 @@ func NewCommand(home string, docker client.CommonAPIClient, output terminal.Outp
},
RunE: func(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()
if ctx == nil {
ctx = context.Background()
}

// check if there is a config file
_, err := config.Load(home)
if errors.Is(err, config.ErrNoConfigFile) {
Expand Down
6 changes: 5 additions & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,11 @@ func (c *Config) createFile(dir string) error {
defer f.Close()

// try to chown otherwise be quiet
return f.Chown(os.Geteuid(), os.Getuid())
if err := f.Chown(os.Geteuid(), os.Getuid()); err != nil {
return nil
}

return nil
}

// GetFile returns the file location for the config
Expand Down
3 changes: 3 additions & 0 deletions pkg/proxycontainer/proxycontainer.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ var (

// Create is used to create a new proxy container for the nitro development environment.
func Create(ctx context.Context, docker client.CommonAPIClient, output terminal.Outputer, networkID string) error {
if ctx == nil {
ctx = context.Background()
}
filter := filters.NewArgs()
filter.Add("label", labels.Nitro+"=true")
filter.Add("reference", ProxyImage)
Expand Down

0 comments on commit ce296c1

Please sign in to comment.