#682: Ensure that script exists
This commit is contained in:
@@ -1,20 +1,26 @@
|
||||
import six
|
||||
from ..logs import warn
|
||||
from ..shells import shell
|
||||
from ..utils import which
|
||||
|
||||
|
||||
def print_alias(known_args):
|
||||
def _get_alias(known_args):
|
||||
if six.PY2:
|
||||
warn("The Fuck will drop Python 2 support soon, more details "
|
||||
"https://github.com/nvbn/thefuck/issues/685")
|
||||
|
||||
alias = shell.app_alias(known_args.alias)
|
||||
|
||||
if known_args.enable_experimental_instant_mode:
|
||||
if six.PY2:
|
||||
warn("Instant mode not supported with Python 2")
|
||||
alias = shell.app_alias(known_args.alias)
|
||||
warn("Instant mode requires Python 3")
|
||||
elif not which('script'):
|
||||
warn("Instant mode requires `script` app")
|
||||
else:
|
||||
alias = shell.instant_mode_alias(known_args.alias)
|
||||
else:
|
||||
alias = shell.app_alias(known_args.alias)
|
||||
return shell.instant_mode_alias(known_args.alias)
|
||||
|
||||
print(alias)
|
||||
return alias
|
||||
|
||||
|
||||
def print_alias(known_args):
|
||||
print(_get_alias(known_args))
|
||||
|
||||
Reference in New Issue
Block a user