Skip to content

Commit

Permalink
chore: omit EDITOR logs by default + tidying
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Gillson <tyler.gillson@gmail.com>
  • Loading branch information
TylerGillson committed Jul 15, 2024
1 parent bb90294 commit 0ca6ae9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions prompts/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ func init() {
editor := os.Getenv("EDITOR")
if visual != "" {
editorBinary = visual
logger.Info(fmt.Sprintf("Detected VISUAL env var. Overrode default editor (vi) with %s.", editorBinary))
logger.Debug(fmt.Sprintf("Detected VISUAL env var. Overrode default editor (vi) with %s.", editorBinary))
} else if editor != "" {
editorBinary = editor
logger.Info(fmt.Sprintf("Detected EDITOR env var. Overrode default editor (vi) with %s.", editorBinary))
logger.Debug(fmt.Sprintf("Detected EDITOR env var. Overrode default editor (vi) with %s.", editorBinary))
}
var err error
editorPath, err = exec.LookPath(editorBinary)
Expand All @@ -44,8 +44,9 @@ func getEditorExecutor(editor, filename string) mocks.CommandExecutor {
return cmd
}

// EditFile prompts a user to edit a file with a predefined prompt and initial content.
func EditFile(initialContent []byte) ([]byte, error) {
tmpFile, err := os.CreateTemp(os.TempDir(), "validator")
tmpFile, err := os.CreateTemp(os.TempDir(), "prompts")
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 0ca6ae9

Please sign in to comment.