parent
f2e530efc5
commit
cc477de841
1 changed files with 6 additions and 8 deletions
14
cd.sh
14
cd.sh
|
@ -10,6 +10,7 @@ CD_REPOSITORY_NAME='cd'
|
|||
CD_DNS_FILE='/etc/resolv.conf'
|
||||
case "${CD_OS_NAME}" in
|
||||
'debian')
|
||||
CD_PYTHON_PACKAGES='/usr/lib/python3/dist-packages'
|
||||
case "${CD_OS_VERSION}" in
|
||||
'bookworm')
|
||||
echo 'TODO'
|
||||
|
@ -33,7 +34,6 @@ else
|
|||
echo 'CD_REPOSITORIES_URL'
|
||||
exit 3
|
||||
fi
|
||||
CD_STEP=0
|
||||
|
||||
function cd_step {
|
||||
if [ "${1}" ] ; then
|
||||
|
@ -185,20 +185,18 @@ function cd_clean_packages_cache {
|
|||
function cd_install {
|
||||
local repository
|
||||
local root
|
||||
local target
|
||||
cd_step "${FUNCNAME}"
|
||||
case "${CD_OS_NAME}" in
|
||||
'debian') target='/usr/lib/python3/dist-packages' || exit ;;
|
||||
*) exit 1 ;;
|
||||
esac
|
||||
root="$(mktemp --directory)" || exit
|
||||
for repository in \
|
||||
"${CD_REPOSITORIES_PARENT}" \
|
||||
"${CD_REPOSITORY_NAME}" \
|
||||
; do
|
||||
git clone \
|
||||
"${CD_REPOSITORIES_URL}/${repository}" "{root}/${repository}" || exit
|
||||
cp --recursive --verbose "${root}/${repository}" "${target}"
|
||||
"${CD_REPOSITORIES_URL}/${repository}" "${root}/${repository}" \
|
||||
|| exit
|
||||
cp --recursive --verbose \
|
||||
"${root}/${repository}" "${CD_PYTHON_PACKAGES}" \
|
||||
|| exit
|
||||
# TODO commands
|
||||
done
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue