fixed packager
This commit is contained in:
parent
fd90802d24
commit
f32dd9d55a
1 changed files with 87 additions and 46 deletions
133
.bashrc
133
.bashrc
|
@ -109,22 +109,95 @@ _source() {
|
||||||
}
|
}
|
||||||
|
|
||||||
_sources() {
|
_sources() {
|
||||||
local sourceDir="$HOME/.bash"
|
_source "$HOME/.bash_aliases"
|
||||||
local sourceOptions=(
|
}
|
||||||
# "aliases"
|
|
||||||
# "defaults"
|
setup-pkg() {
|
||||||
"installs"
|
case "$1" in
|
||||||
|
apt)
|
||||||
|
install() {
|
||||||
|
if command-exists nala; then
|
||||||
|
$_sudo nala install --assume-yes "$@"
|
||||||
|
else
|
||||||
|
$_sudo apt install --color=always --assume-yes "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
if command_exists nala; then
|
||||||
|
alias search="nala search"
|
||||||
|
alias update="$_sudo nala update && $_sudo nala upgrade --full"
|
||||||
|
alias remove="$_sudo nala purge"
|
||||||
|
else
|
||||||
|
alias search="apt-cache search"
|
||||||
|
alias update="$_sudo apt update && $_sudo apt upgrade"
|
||||||
|
alias remove="$_sudo apt purge"
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
pacman)
|
||||||
|
install() {
|
||||||
|
if command_exists paru; then
|
||||||
|
paru -S --no-confirm --color=always "$@"
|
||||||
|
elif command_exists yay; then
|
||||||
|
yay -S --no-confirm --color=always "$@"
|
||||||
|
else
|
||||||
|
$_sudo pacman -S --no-confirm --color=always "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
if command_exists paru; then
|
||||||
|
alias search="paru -Ss"
|
||||||
|
alias update="paru -Syu"
|
||||||
|
alias remove="paru -R"
|
||||||
|
elif command_exists yay; then
|
||||||
|
alias search="yay -Ss"
|
||||||
|
alias update="yay -Syu"
|
||||||
|
alias remove="yay -R"
|
||||||
|
else
|
||||||
|
alias search="pacman -Ss"
|
||||||
|
alias update="$_sudo pacman -Syu"
|
||||||
|
alias remove="$_sudo pacman -R"
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
dnf)
|
||||||
|
alias install="$_sudo dnf install"
|
||||||
|
alias search="pacman -Ss"
|
||||||
|
alias update="$_sudo pacman -Syu"
|
||||||
|
alias remove="$_sudo pacman -R"
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
zypper)
|
||||||
|
alias install="$_sudo zypper install"
|
||||||
|
alias search="zypper search"
|
||||||
|
alias update="$_sudo zypper dup"
|
||||||
|
alias remove="$_sudo zypper remove"
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
apk)
|
||||||
|
alias install="$_sudo apk add"
|
||||||
|
alias search="apk search"
|
||||||
|
alias update="$_sudo apk update && $_sudo apk upgrade"
|
||||||
|
alias remove="$_sudo apk del"
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
local pkg=() p
|
||||||
|
|
||||||
|
pkg=(
|
||||||
|
apt
|
||||||
|
dnf
|
||||||
|
pacman
|
||||||
|
zypper
|
||||||
|
apk
|
||||||
)
|
)
|
||||||
|
|
||||||
[[ -e "$HOME/.bash_aliases" ]] &&
|
for p in "${pkg[@]}"; do
|
||||||
. "$HOME/.bash_aliases"
|
if command_exists $p; then
|
||||||
|
setup-pkg $p
|
||||||
for _s in "${sourceOptions[@]}"; do
|
break
|
||||||
local _sourceFile="${sourceDir}/.${_s}.sh"
|
|
||||||
if [ -e "$_sourceFile" ]; then
|
|
||||||
. "$_sourceFile"
|
|
||||||
fi
|
fi
|
||||||
local _source_""
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,38 +265,6 @@ _init() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# ─< ble.sh -- https://github.com/akinomyoga/ble.sh >─────────────────────────────────────
|
|
||||||
# d_blesh() {
|
|
||||||
# for deeps in git make gawk; do
|
|
||||||
# if ! command_exists $deeps; then
|
|
||||||
# echo_error "$deeps was missing from the system, cannot setup shell properly! (blesh setup)"
|
|
||||||
# exit 1
|
|
||||||
# fi
|
|
||||||
# done
|
|
||||||
# }
|
|
||||||
|
|
||||||
# i_blesh() {
|
|
||||||
# local tmp_dir="$(mktemp -d)"
|
|
||||||
#
|
|
||||||
# cd "$tmp_dir" || echo_error "$tmp_dir is not valid!"
|
|
||||||
# git clone --recursive --depth 1 --shallow-submodules https://github.com/akinomyoga/ble.sh.git
|
|
||||||
# make -C ble.sh install PREFIX=~/.local
|
|
||||||
# . "$HOME/.local/share/blesh/ble.sh"
|
|
||||||
# # bash
|
|
||||||
# # cd "$HOME" || return 0
|
|
||||||
# }
|
|
||||||
|
|
||||||
# _blesh() {
|
|
||||||
# if [ ! -f $HOME/.local/share/blesh/ble.sh ]; then
|
|
||||||
# d_blesh # Dependency check for blesh
|
|
||||||
# echo_info "Installing blesh.. Depending on your internet connection and the performance of the client, this could take a minute or two.."
|
|
||||||
# i_blesh # installing blesh silently
|
|
||||||
# else
|
|
||||||
# # . "$HOME/.local/share/blesh/ble.sh" --attach=none
|
|
||||||
# . "$HOME/.local/share/blesh/ble.sh"
|
|
||||||
# fi
|
|
||||||
# }
|
|
||||||
|
|
||||||
_env() {
|
_env() {
|
||||||
local essentials=(
|
local essentials=(
|
||||||
neovim
|
neovim
|
||||||
|
@ -332,6 +373,7 @@ main() {
|
||||||
_color_prompt_
|
_color_prompt_
|
||||||
_env
|
_env
|
||||||
check_root
|
check_root
|
||||||
|
setup-pkg
|
||||||
_end
|
_end
|
||||||
|
|
||||||
_source "$HOME/.bash_aliases"
|
_source "$HOME/.bash_aliases"
|
||||||
|
@ -348,7 +390,6 @@ main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
main
|
main
|
||||||
|
|
||||||
if $blesh; then
|
if $blesh; then
|
||||||
set -o vi
|
set -o vi
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue