Skip to content

Commit

Permalink
Merge pull request #16 from snarlysodboxer/stop-at-root
Browse files Browse the repository at this point in the history
Stop search for config dirs at root
  • Loading branch information
snarlysodboxer authored Sep 20, 2022
2 parents 3e807db + 4a6ceaf commit 7869391
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ This is alpha, but ready for use.
## Install
Download the binary for your system and then move it in place
```shell
mv ~/Downloads/preditable-yaml-darwin-amd64 /usr/local/bin/preditable-yaml
chmod ug+x /usr/local/bin/preditable-yaml
mv ~/Downloads/predictable-yaml-darwin-amd64 /usr/local/bin/predictable-yaml
chmod ug+x /usr/local/bin/predictable-yaml
# on MacOS
sudo xattr -r -d com.apple.quarantine /usr/local/bin/preditable-yaml
sudo xattr -r -d com.apple.quarantine /usr/local/bin/predictable-yaml
```
OR just clone the repo and `go install`.

Expand Down
4 changes: 4 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ func walkFindConfigDirs(dir string, configDirs []string) ([]string, error) {
return configDirs, nil
}
parentDir := filepath.Dir(dir)
if parentDir == dir {
// reached root
return configDirs, nil
}
configDirs, err = walkFindConfigDirs(parentDir, configDirs)
if err != nil {
return nil, err
Expand Down

0 comments on commit 7869391

Please sign in to comment.