Skip to content
Myr

Fix bashism in get_editor()

Before adoption: this commit came in with the history the project adopted, so no landing records it.

This causes the path to the editor to get printed if the shell spawned by os.system is not Bash.

authored by Sylvain Fankhauser · committed by Sylvain Fankhauser · parent de40ee6 · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:click/_termui_impl.py+1 added-1 removed
347 unmodified lines
348 return rv349 if WIN:350 return 'notepad'351 for editor in 'vim', 'nano':352 if os.system('which %s &> /dev/null' % editor) == 0:352 if os.system('which %s >/dev/null 2>&1' % editor) == 0:353 return editor354 return 'vi'355356 def edit_file(self, filename):
153 unmodified lines