mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-18 20:11:17 +00:00
#1279: Add pikaur AUR manager to Arch Linux's commands
* Add pikaur AUR manager to Arch Linux's commands * Update README.md * Update test_pacman_not_found.py * Update pacman_not_found.py * Update README.md Co-authored-by: Pablo Aguiar <scorphus@gmail.com>
This commit is contained in:
parent
cf1beb6b89
commit
d8ddf5a2be
@ -360,9 +360,9 @@ The following rules are enabled by default on specific platforms only:
|
|||||||
* `brew_update_formula` – turns `brew update <formula>` into `brew upgrade <formula>`;
|
* `brew_update_formula` – turns `brew update <formula>` into `brew upgrade <formula>`;
|
||||||
* `dnf_no_such_command` – fixes mistyped DNF commands;
|
* `dnf_no_such_command` – fixes mistyped DNF commands;
|
||||||
* `nixos_cmd_not_found` – installs apps on NixOS;
|
* `nixos_cmd_not_found` – installs apps on NixOS;
|
||||||
* `pacman` – installs app with `pacman` if it is not installed (uses `yay` or `yaourt` if available);
|
* `pacman` – installs app with `pacman` if it is not installed (uses `yay`, `pikaur` or `yaourt` if available);
|
||||||
* `pacman_invalid_option` – replaces lowercase `pacman` options with uppercase.
|
* `pacman_invalid_option` – replaces lowercase `pacman` options with uppercase.
|
||||||
* `pacman_not_found` – fixes package name with `pacman`, `yay` or `yaourt`.
|
* `pacman_not_found` – fixes package name with `pacman`, `yay`, `pikaur` or `yaourt`.
|
||||||
* `yum_invalid_operation` – fixes invalid `yum` calls, like `yum isntall vim`;
|
* `yum_invalid_operation` – fixes invalid `yum` calls, like `yum isntall vim`;
|
||||||
|
|
||||||
The following commands are bundled with *The Fuck*, but are not enabled by
|
The following commands are bundled with *The Fuck*, but are not enabled by
|
||||||
|
@ -12,6 +12,7 @@ extra/llvm35 3.5.2-13/usr/bin/llc'''
|
|||||||
reason='Skip if pacman is not available')
|
reason='Skip if pacman is not available')
|
||||||
@pytest.mark.parametrize('command', [
|
@pytest.mark.parametrize('command', [
|
||||||
Command('yay -S llc', 'error: target not found: llc'),
|
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('yaourt -S llc', 'error: target not found: llc'),
|
||||||
Command('pacman llc', 'error: target not found: llc'),
|
Command('pacman llc', 'error: target not found: llc'),
|
||||||
Command('sudo pacman llc', 'error: target not found: llc')])
|
Command('sudo pacman llc', 'error: target not found: llc')])
|
||||||
@ -21,6 +22,7 @@ def test_match(command):
|
|||||||
|
|
||||||
@pytest.mark.parametrize('command', [
|
@pytest.mark.parametrize('command', [
|
||||||
Command('yay -S llc', 'error: target not found: llc'),
|
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('yaourt -S llc', 'error: target not found: llc'),
|
||||||
Command('pacman llc', 'error: target not found: llc'),
|
Command('pacman llc', 'error: target not found: llc'),
|
||||||
Command('sudo pacman llc', 'error: target not found: llc')])
|
Command('sudo pacman llc', 'error: target not found: llc')])
|
||||||
@ -34,6 +36,7 @@ def test_match_mocked(subp_mock, command):
|
|||||||
reason='Skip if pacman is not available')
|
reason='Skip if pacman is not available')
|
||||||
@pytest.mark.parametrize('command, fixed', [
|
@pytest.mark.parametrize('command, fixed', [
|
||||||
(Command('yay -S llc', 'error: target not found: llc'), ['yay -S extra/llvm', 'yay -S extra/llvm35']),
|
(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('yaourt -S llc', 'error: target not found: llc'), ['yaourt -S extra/llvm', 'yaourt -S extra/llvm35']),
|
||||||
(Command('pacman -S llc', 'error: target not found: llc'), ['pacman -S extra/llvm', 'pacman -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'])])
|
(Command('sudo pacman -S llc', 'error: target not found: llc'), ['sudo pacman -S extra/llvm', 'sudo pacman -S extra/llvm35'])])
|
||||||
@ -43,6 +46,7 @@ def test_get_new_command(command, fixed):
|
|||||||
|
|
||||||
@pytest.mark.parametrize('command, fixed', [
|
@pytest.mark.parametrize('command, fixed', [
|
||||||
(Command('yay -S llc', 'error: target not found: llc'), ['yay -S extra/llvm', 'yay -S extra/llvm35']),
|
(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('yaourt -S llc', 'error: target not found: llc'), ['yaourt -S extra/llvm', 'yaourt -S extra/llvm35']),
|
||||||
(Command('pacman -S llc', 'error: target not found: llc'), ['pacman -S extra/llvm', 'pacman -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'])])
|
(Command('sudo pacman -S llc', 'error: target not found: llc'), ['sudo pacman -S extra/llvm', 'sudo pacman -S extra/llvm35'])])
|
||||||
|
@ -12,7 +12,7 @@ from thefuck.specific.archlinux import get_pkgfile, archlinux_env
|
|||||||
|
|
||||||
def match(command):
|
def match(command):
|
||||||
return (command.script_parts
|
return (command.script_parts
|
||||||
and (command.script_parts[0] in ('pacman', 'yay', 'yaourt')
|
and (command.script_parts[0] in ('pacman', 'yay', 'pikaur', 'yaourt')
|
||||||
or command.script_parts[0:2] == ['sudo', 'pacman'])
|
or command.script_parts[0:2] == ['sudo', 'pacman'])
|
||||||
and 'error: target not found:' in command.output)
|
and 'error: target not found:' in command.output)
|
||||||
|
|
||||||
|
@ -34,6 +34,8 @@ def get_pkgfile(command):
|
|||||||
def archlinux_env():
|
def archlinux_env():
|
||||||
if utils.which('yay'):
|
if utils.which('yay'):
|
||||||
pacman = 'yay'
|
pacman = 'yay'
|
||||||
|
elif utils.which('pikaur'):
|
||||||
|
pacman = 'pikaur'
|
||||||
elif utils.which('yaourt'):
|
elif utils.which('yaourt'):
|
||||||
pacman = 'yaourt'
|
pacman = 'yaourt'
|
||||||
elif utils.which('pacman'):
|
elif utils.which('pacman'):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user