1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-01-18 12:06:04 +00:00

Fix a couple small shellcheck errors (#915)

* Fix shellcheck SC2046

Further reading: https://github.com/koalaman/shellcheck/wiki/Sc2046

* Fix shellcheck 2068

Further reading: https://github.com/koalaman/shellcheck/wiki/Sc2068

* Fix syntax error from bad quoting

I also used a docstring here because the escaping makes it harder for
humans to parse
This commit is contained in:
Ryan Delaney 2019-05-22 11:22:09 -07:00 committed by Vladimir Iakovlev
parent 201c01fc74
commit 70a13406f0
2 changed files with 5 additions and 5 deletions

View File

@ -20,8 +20,8 @@ class Bash(Generic):
export TF_HISTORY=$(fc -ln -10);
export PYTHONIOENCODING=utf-8;
TF_CMD=$(
thefuck {argument_placeholder} $@
) && eval $TF_CMD;
thefuck {argument_placeholder} "$@"
) && eval "$TF_CMD";
unset TF_HISTORY;
export PYTHONIOENCODING=$TF_PYTHONIOENCODING;
{alter_history}
@ -79,7 +79,7 @@ class Bash(Generic):
config = 'bash config'
return self._create_shell_configuration(
content=u'eval $(thefuck --alias)',
content=u'eval "$(thefuck --alias)"',
path=config,
reload=u'source {}'.format(config))

View File

@ -34,8 +34,8 @@ class Generic(object):
return command_script
def app_alias(self, alias_name):
return "alias {0}='eval $(TF_ALIAS={0} PYTHONIOENCODING=utf-8 " \
"thefuck $(fc -ln -1))'".format(alias_name)
return """alias {0}='eval "$(TF_ALIAS={0} PYTHONIOENCODING=utf-8 """ \
"""thefuck "$(fc -ln -1)")"'""".format(alias_name)
def instant_mode_alias(self, alias_name):
warn("Instant mode not supported by your shell")