Skip to content

Commit

Permalink
Merge pull request #82 from breml/envrc
Browse files Browse the repository at this point in the history
Allow .envrc for dotenv segment
  • Loading branch information
justjanne authored May 11, 2018
2 parents 2d68816 + 297cc97 commit c934340
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions segment-dotenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@ import (
)

func segmentDotEnv(p *powerline) {
stat, err := os.Stat(".env")
if err == nil && !stat.IsDir() {
files := []string{".env", ".envrc"}
dotEnv := false
for _, file := range files {
stat, err := os.Stat(file)
if err == nil && !stat.IsDir() {
dotEnv = true
break
}
}
if dotEnv {
p.appendSegment("dotenv", segment{
content: "\u2235",
foreground: p.theme.DotEnvFg,
Expand Down

0 comments on commit c934340

Please sign in to comment.