diff --git a/pidd.sh b/pidd.sh index 0796472..5c3ce4d 100644 --- a/pidd.sh +++ b/pidd.sh @@ -372,8 +372,9 @@ Acquire::https::Verify-Peer False; # github → gitea → forgejo if [ -n "${GITHUB_SERVER_URL}" ]; then PIDD_PROJECT_ROOT="$(dirname "${GITHUB_SERVER_URL}")//" - [ -n "${GITHUB_TOKEN}" ] && + if [ -n "${GITHUB_TOKEN}" ]; then PIDD_PROJECT_ROOT="${PIDD_PROJECT_ROOT}${GITHUB_TOKEN}@" + fi PIDD_PROJECT_ROOT="${PIDD_PROJECT_ROOT}$(basename "${GITHUB_SERVER_URL}")" else pidd_error_ci "GITHUB_SERVER_URL" @@ -700,10 +701,11 @@ pidd_error_os() { pidd_grep_os() { pidd_grep_os__variable="${1}" - [ -n "${pidd_grep_os__variable}" ] && + if [ -n "${pidd_grep_os__variable}" ]; then grep "^${pidd_grep_os__variable}=" "/etc/os-release" | - sed "s|^${pidd_grep_os__variable}=||" | + sed "s|^${pidd_grep_os__variable}=||" | sed "s|^\"\(.*\)\"$|\1|" + fi } pidd_install_package() { @@ -717,8 +719,8 @@ pidd_ln_python() { pidd_ln_python__command="${1}" if [ -n "${pidd_ln_python__command}" ]; then echo "→ ${PIDD_PYTHON_ALIAS} → ${pidd_ln_python__command}" - ln -f -s "${pidd_ln_python__command}" \ - "/usr/bin/${PIDD_PYTHON_ALIAS}" || exit + ln -f -s "${pidd_ln_python__command}" "/usr/bin/${PIDD_PYTHON_ALIAS}" || + exit fi } @@ -768,7 +770,8 @@ pidd_sed() { pidd_cat "${pidd_sed__file}" for pidd_sed__regex in "${@}"; do sed --in-place "s${pidd_sed__regex}g" "${pidd_sed__file}" && - pidd_cat "${pidd_sed__file}" || exit + pidd_cat "${pidd_sed__file}" || + exit done fi } diff --git a/readme.md b/readme.md index 46e76d8..ffa663e 100644 --- a/readme.md +++ b/readme.md @@ -88,7 +88,9 @@ from various contexts of CA, CI and OCI / OS. * lint * .py * .sh +* write bootstrap entry point ### .sh +* reduce single conditions with && * support opensuse