1
0
Fork 0

Implement running as default

master
LEdoian 5 years ago
parent 20887b71c9
commit 8d97393257

@ -122,7 +122,10 @@ def user_action(hunk: Sequence[Command], context=None) -> Sequence[Command]:
print(stringify_hunk(hunk)) print(stringify_hunk(hunk))
# TODO: Print prompt in color (green?) # TODO: Print prompt in color (green?)
answer = input("What to do: edit(e), run(y), skip(n)?") answer = input("What to do: edit(e), run(y, default), skip(n)?")
if answer is None:
# Default is run, for convenience
answer = 'Y'
if answer.startswith(('e', 'E')): if answer.startswith(('e', 'E')):
import tempfile import tempfile
with tempfile.NamedTemporaryFile(mode='r+') as tmpfile: with tempfile.NamedTemporaryFile(mode='r+') as tmpfile:

Loading…
Cancel
Save