mirror of
https://gitea.blesmrt.net/mikaela/scripts.git
synced 2024-11-15 23:59:25 +01:00
usr-local-bin/pacman: initial commit
made on Fedora instead of actual Arch, so let's see if this will work
This commit is contained in:
parent
54751b14f0
commit
7099439e0e
1
bash/usr-local-bin/.gitignore
vendored
1
bash/usr-local-bin/.gitignore
vendored
@ -9,3 +9,4 @@ ff
|
|||||||
chrome
|
chrome
|
||||||
iwd-wifi.bash
|
iwd-wifi.bash
|
||||||
vim
|
vim
|
||||||
|
yay
|
||||||
|
25
bash/usr-local-bin/pacman
Executable file
25
bash/usr-local-bin/pacman
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -x
|
||||||
|
|
||||||
|
export LC_ALL=en_DK.UTF-8
|
||||||
|
|
||||||
|
# if yay is installed and we aren't root, run it instead
|
||||||
|
if [[ -f /usr/bin/yay && $(id -u) != 0 ]]; then
|
||||||
|
if [[ "$1" == "-S" ]]; then
|
||||||
|
/usr/bin/yay --needed "$*"
|
||||||
|
else
|
||||||
|
/usr/bin/yay "$*"
|
||||||
|
fi
|
||||||
|
# otherwise attempt to run pacman, but keep the --needed for installs
|
||||||
|
elif [[ -f /usr/bin/pacman ]]; then
|
||||||
|
if [[ "$1" == "-S" ]]; then
|
||||||
|
/usr/bin/pacman --needed "$*"
|
||||||
|
else
|
||||||
|
/usr/bin/pacman "$*"
|
||||||
|
fi
|
||||||
|
# otherwise fail gracefully
|
||||||
|
else
|
||||||
|
printf "Neither yay or pacman was found.\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
set +x
|
1
bash/usr-local-bin/yay
Symbolic link
1
bash/usr-local-bin/yay
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
pacman
|
Loading…
Reference in New Issue
Block a user