Skip to content

Commit

Permalink
allow turning off prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
seanenck committed Nov 24, 2024
1 parent c4fdf32 commit 68d87f1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/uncommitted/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ func Current(s Settings) error {
if s.Writer == nil {
return errors.New("writer is nil")
}
const key = "GIT_UNCOMMITTED"
switch s.Mode {
case "pwd":
if cli.IsYes(os.Getenv(key + "_NO_PROMPT")) {
return nil
}
wd, err := os.Getwd()
if err != nil {
return err
Expand All @@ -67,7 +71,6 @@ func Current(s Settings) error {
default:
return fmt.Errorf("unknown mode: %s", s.Mode)
}
const key = "GIT_UNCOMMITTED"
in := strings.TrimSpace(os.Getenv(key))
if in == "" {
return nil
Expand Down

0 comments on commit 68d87f1

Please sign in to comment.