cd_rm
Some checks failed
/ job (push) Failing after 4s

This commit is contained in:
Marc Beninca 2024-04-28 13:00:18 +02:00
parent e13563622f
commit 7cfd0247f0
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
2 changed files with 16 additions and 4 deletions

19
cd.sh
View file

@ -125,6 +125,7 @@ deb https://deb.debian.org/debian bookworm-backports main
deb https://deb.debian.org/debian bookworm-updates main deb https://deb.debian.org/debian bookworm-updates main
deb https://deb.debian.org/debian-security bookworm-security main deb https://deb.debian.org/debian-security bookworm-security main
" "
cd_cat "/etc/apt/sources.list"
;; ;;
*) exit 1 ;; *) exit 1 ;;
esac esac
@ -142,6 +143,7 @@ APT::Install-Recommends False;
APT::Install-Suggests False; APT::Install-Suggests False;
Dir::Etc::SourceParts \"\"; Dir::Etc::SourceParts \"\";
" "
cd_cat "/etc/apt/apt.conf.d/apt.conf"
;; ;;
*) exit 1 ;; *) exit 1 ;;
esac esac
@ -154,6 +156,7 @@ cd_set_https_verification_off () {
cd_write "/etc/apt/apt.conf.d/https" "\ cd_write "/etc/apt/apt.conf.d/https" "\
Acquire::https::Verify-Peer False; Acquire::https::Verify-Peer False;
" "
cd_cat "/etc/apt/apt.conf.d/https"
;; ;;
*) exit 1 ;; *) exit 1 ;;
esac esac
@ -196,7 +199,7 @@ local target
cd_update_ca () { cd_update_ca () {
cd_step "Update CA" cd_step "Update CA"
case "${CD_OS_NAME}" in case "${CD_OS_NAME}" in
"debian") update-ca-certificates ;; "debian") update-ca-certificates || exit ;;
*) exit 1 ;; *) exit 1 ;;
esac esac
} }
@ -204,7 +207,7 @@ cd_update_ca () {
cd_set_https_verification_on () { cd_set_https_verification_on () {
cd_step "Set HTTPS verification on" cd_step "Set HTTPS verification on"
case "${CD_OS_NAME}" in case "${CD_OS_NAME}" in
"debian") rm "/etc/apt/apt.conf.d/https" ;; "debian") cd_rm "/etc/apt/apt.conf.d/https" ;;
*) exit 1 ;; *) exit 1 ;;
esac esac
} }
@ -247,6 +250,7 @@ local root
cd_step "Clone parent repositories" cd_step "Clone parent repositories"
root="$(mktemp --directory)" || exit root="$(mktemp --directory)" || exit
for repository in "${@}" ; do for repository in "${@}" ; do
echo "${repository}"
git clone \ git clone \
"${CD_PROJECTS_URL}/${repository}" "${root}/${repository}" \ "${CD_PROJECTS_URL}/${repository}" "${root}/${repository}" \
|| exit || exit
@ -266,8 +270,8 @@ cd_set_python_commands () {
cd_cat () { cd_cat () {
if [ -f "${1}" ] ; then if [ -f "${1}" ] ; then
echo "$(realpath "${1}")" echo "$(realpath "${1}")"
cat "${1}" cat "${1}" || exit
fi fi
} }
@ -280,6 +284,13 @@ cd_install_package () {
fi fi
} }
cd_rm () {
if [ -f "${1}" ] ; then
echo "×$(realpath "${1}")"
rm "${1}" || exit
fi
}
cd_step () { cd_step () {
if [ "${1}" ] ; then if [ "${1}" ] ; then
CD_STEP=$((CD_STEP+1)) CD_STEP=$((CD_STEP+1))

View file

@ -31,4 +31,5 @@ def install_commands(path):
'clone-branch', 'clone-branch',
'list-environment', 'list-environment',
]: ]:
print(command)
os.symlink(path, os.path.join(user, f'{COMMANDS_PREFIX}{command}')) os.symlink(path, os.path.join(user, f'{COMMANDS_PREFIX}{command}'))