This commit is contained in:
Ohio2 2021-10-03 00:15:40 +02:00
parent 41d1ff0628
commit fad2ddd2c3
Signed by: Ohio2
GPG key ID: 2746D0A9E4F21E80

25
aps
View file

@ -8,19 +8,21 @@
# OHIO: it's rewritten however it has some old code from aps (v0.0.8.1)
# KEMAL: abandon all hope, ye who enter here.
# OHIO: ^, however my code is cleaner than the mess before.
if [ -f "$XDG_CONFIG_HOME/al/config" ]; then
function conf_fetch(){
if [ -f "$XDG_CONFIG_HOME/al/config" ]; then
. $XDG_CONFIG_HOME/al/config
elif [ -f "$HOME/.config/al/config" ]; then
elif [ -f "$HOME/.config/al/config" ]; then
. $HOME/.config/al/config
elif [ -f "/etc/al/config" ]; then
elif [ -f "/etc/al/config" ]; then
. /etc/al/config
elif [ -f "/etc/skel/al/config" ]; then
elif [ -f "/etc/skel/al/config" ]; then
. /etc/skel/al/config
elif [ -f $AL_CFG ]; then
. $AL_CFG
else
wrn "No config file!"
fi
#elif [ -f $AL_CFG ]; then
# . $AL_CFG
else
err "No config file!"
fi
}
case ${debug} in
on) set -x ;;
esac
@ -36,9 +38,10 @@ function wrn(){
#}
function err(){
echo -e "\e[34m==>\e[31m ERROR:\e[39m $1" &&
rm ${lock} 2> /dev/null &&
rm ${lock} 2> /dev/null
exit 2
}
conf_fetch
function notf(){
echo -e "\e[34m==>\e[36m NOTIFICATION:\e[39m $1"
}
@ -200,7 +203,7 @@ sync_local_repo_database() {
git clone "${2}" "${locpkg_database}/${1}"
else
# Local database for repo already exists - sync it
cd "${locpkg_database}/${1}" || die "Could not enter local database directory. Exiting..."
cd "${locpkg_database}/${1}" || err "Could not enter local database directory. Exiting..."
git pull
fi
}