cd_mkdir
Some checks failed
/ job (push) Failing after 1m55s

This commit is contained in:
Marc Beninca 2024-04-29 20:16:14 +02:00
parent 903e203857
commit 58c689a059
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

13
cd.sh
View file

@ -140,7 +140,7 @@ APT::Install-Suggests False;
Dir::Etc::SourceParts \"\"; Dir::Etc::SourceParts \"\";
" "
;; ;;
"alma") mkdir "/etc/dnf/dnf.conf.d" || exit ;; "alma") cd_mkdir "/etc/dnf/dnf.conf.d" ;;
*) cd_error_os "cd_set_packages_configuration" ;; *) cd_error_os "cd_set_packages_configuration" ;;
esac esac
} }
@ -288,7 +288,7 @@ ${1}
cd_cat () { cd_cat () {
if [ -f "${1}" ] ; then if [ -f "${1}" ] ; then
echo "$(realpath "${1}")" echo " ↙ /etc$(realpath "${1}")"
cat "${1}" || exit cat "${1}" || exit
fi fi
} }
@ -312,9 +312,16 @@ cd_install_package () {
fi fi
} }
cd_mkdir () {
if [ "${1}" ] ; then
echo "${1}"
mkdir --parents "${1}" || exit
fi
}
cd_rm () { cd_rm () {
if [ -e "${1}" ] ; then if [ -e "${1}" ] ; then
echo "× $(realpath "${1}")" echo " $(realpath "${1}")"
rm --recursive "${1}" || exit rm --recursive "${1}" || exit
fi fi
} }