Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,9 @@ The following rules are enabled by default on specific platforms only:
* `brew_update_formula` &ndash; turns `brew update <formula>` into `brew upgrade <formula>`;
* `dnf_no_such_command` &ndash; fixes mistyped DNF commands;
* `nixos_cmd_not_found` &ndash; installs apps on NixOS;
* `pacman` &ndash; installs app with `pacman` if it is not installed (uses `yay`, `pikaur` or `yaourt` if available);
* `pacman` &ndash; installs app with `pacman` if it is not installed (uses `yay`, `pikaur`, `yaourt` or `paru` if available);
* `pacman_invalid_option` &ndash; replaces lowercase `pacman` options with uppercase.
* `pacman_not_found` &ndash; fixes package name with `pacman`, `yay`, `pikaur` or `yaourt`.
* `pacman_not_found` &ndash; fixes package name with `pacman`, `yay`, `pikaur`, `yaourt` or `paru`.
* `yum_invalid_operation` &ndash; fixes invalid `yum` calls, like `yum isntall vim`;

The following commands are bundled with *The Fuck*, but are not enabled by
Expand Down
4 changes: 4 additions & 0 deletions tests/rules/test_pacman_not_found.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
Command('yay -S llc', 'error: target not found: llc'),
Command('pikaur -S llc', 'error: target not found: llc'),
Command('yaourt -S llc', 'error: target not found: llc'),
Command('paru -S llc', 'error: target not found: llc'),
Command('pacman llc', 'error: target not found: llc'),
Command('sudo pacman llc', 'error: target not found: llc')])
def test_match(command):
Expand All @@ -24,6 +25,7 @@ def test_match(command):
Command('yay -S llc', 'error: target not found: llc'),
Command('pikaur -S llc', 'error: target not found: llc'),
Command('yaourt -S llc', 'error: target not found: llc'),
Command('paru -S llc', 'error: target not found: llc'),
Command('pacman llc', 'error: target not found: llc'),
Command('sudo pacman llc', 'error: target not found: llc')])
@patch('thefuck.specific.archlinux.subprocess')
Expand All @@ -38,6 +40,7 @@ def test_match_mocked(subp_mock, command):
(Command('yay -S llc', 'error: target not found: llc'), ['yay -S extra/llvm', 'yay -S extra/llvm35']),
(Command('pikaur -S llc', 'error: target not found: llc'), ['pikaur -S extra/llvm', 'pikaur -S extra/llvm35']),
(Command('yaourt -S llc', 'error: target not found: llc'), ['yaourt -S extra/llvm', 'yaourt -S extra/llvm35']),
(Command('paru -S llc', 'error: target not found: llc'), ['paru -S extra/llvm', 'paru -S extra/llvm35']),
(Command('pacman -S llc', 'error: target not found: llc'), ['pacman -S extra/llvm', 'pacman -S extra/llvm35']),
(Command('sudo pacman -S llc', 'error: target not found: llc'), ['sudo pacman -S extra/llvm', 'sudo pacman -S extra/llvm35'])])
def test_get_new_command(command, fixed):
Expand All @@ -48,6 +51,7 @@ def test_get_new_command(command, fixed):
(Command('yay -S llc', 'error: target not found: llc'), ['yay -S extra/llvm', 'yay -S extra/llvm35']),
(Command('pikaur -S llc', 'error: target not found: llc'), ['pikaur -S extra/llvm', 'pikaur -S extra/llvm35']),
(Command('yaourt -S llc', 'error: target not found: llc'), ['yaourt -S extra/llvm', 'yaourt -S extra/llvm35']),
(Command('paru -S llc', 'error: target not found: llc'), ['paru -S extra/llvm', 'paru -S extra/llvm35']),
(Command('pacman -S llc', 'error: target not found: llc'), ['pacman -S extra/llvm', 'pacman -S extra/llvm35']),
(Command('sudo pacman -S llc', 'error: target not found: llc'), ['sudo pacman -S extra/llvm', 'sudo pacman -S extra/llvm35'])])
@patch('thefuck.specific.archlinux.subprocess')
Expand Down
2 changes: 1 addition & 1 deletion thefuck/rules/pacman_not_found.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

def match(command):
return (command.script_parts
and (command.script_parts[0] in ('pacman', 'yay', 'pikaur', 'yaourt')
and (command.script_parts[0] in ('pacman', 'yay', 'pikaur', 'yaourt', 'paru')
or command.script_parts[0:2] == ['sudo', 'pacman'])
and 'error: target not found:' in command.output)

Expand Down
2 changes: 2 additions & 0 deletions thefuck/specific/archlinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ def archlinux_env():
pacman = 'pikaur'
elif utils.which('yaourt'):
pacman = 'yaourt'
elif utils.which('paru'):
pacman = 'paru'
elif utils.which('pacman'):
pacman = 'sudo pacman'
else:
Expand Down