mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-31 02:01:13 +00:00
#1 Don't fuck twice
This commit is contained in:
parent
636ce7c507
commit
48831fa850
2
setup.py
2
setup.py
@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|||||||
|
|
||||||
|
|
||||||
setup(name='thefuck',
|
setup(name='thefuck',
|
||||||
version=1.4,
|
version=1.5,
|
||||||
description="Magnificent app which corrects your previous console command",
|
description="Magnificent app which corrects your previous console command",
|
||||||
author='Vladimir Iakovlev',
|
author='Vladimir Iakovlev',
|
||||||
author_email='nvbn.rm@gmail.com',
|
author_email='nvbn.rm@gmail.com',
|
||||||
|
@ -74,13 +74,21 @@ def run_rule(rule, command, settings):
|
|||||||
print(new_command)
|
print(new_command)
|
||||||
|
|
||||||
|
|
||||||
|
def is_second_run(command):
|
||||||
|
"""It's second run of `fuck`?"""
|
||||||
|
return command.script.startswith('fuck')
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
command = get_command(sys.argv)
|
command = get_command(sys.argv)
|
||||||
user_dir = setup_user_dir()
|
if is_second_run(command):
|
||||||
settings = get_settings(user_dir)
|
print("echo Can't fuck twice")
|
||||||
rules = get_rules(user_dir, settings)
|
|
||||||
matched_rule = get_matched_rule(command, rules, settings)
|
|
||||||
if matched_rule:
|
|
||||||
run_rule(matched_rule, command, settings)
|
|
||||||
else:
|
else:
|
||||||
print('echo No fuck given')
|
user_dir = setup_user_dir()
|
||||||
|
settings = get_settings(user_dir)
|
||||||
|
rules = get_rules(user_dir, settings)
|
||||||
|
matched_rule = get_matched_rule(command, rules, settings)
|
||||||
|
if matched_rule:
|
||||||
|
run_rule(matched_rule, command, settings)
|
||||||
|
else:
|
||||||
|
print('echo No fuck given')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user