Skip to content

Commit

Permalink
Merge pull request #196 from liveview-native/bc-default-input-for-fil…
Browse files Browse the repository at this point in the history
…e-write

Allow a default value for file write prompt
  • Loading branch information
bcardarella authored Aug 9, 2024
2 parents 3f0e381 + d25c46a commit f80ec7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/mix/tasks/lvn.setup.config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ defmodule Mix.Tasks.Lvn.Setup.Config do
original = File.read!(path)

if original != source do
"#{IO.ANSI.yellow()}Write to #{IO.ANSI.green()}#{IO.ANSI.bright()}#{path}#{IO.ANSI.reset()}\n(y)es (n)o (d)iff\n>"
"#{IO.ANSI.yellow()}Write to #{IO.ANSI.green()}#{IO.ANSI.bright()}#{path}#{IO.ANSI.reset()}\n(Y)es (n)o (d)iff\n>"
|> Mix.Shell.IO.prompt()
|> String.trim()
|> case do
Expand All @@ -645,7 +645,7 @@ defmodule Mix.Tasks.Lvn.Setup.Config do
|> Mix.shell.info()

write_file(context, source, path)
"y" -> File.write!(path, source)
char when char in ["y", "Y", "\n"] -> File.write!(path, source)
"n" -> nil
_other -> write_file(context, source, path)
end
Expand Down

0 comments on commit f80ec7e

Please sign in to comment.