From 571497c5cfa4ac612e5bca06f2c6b39c8412754e Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 12:35:51 +0200 Subject: [PATCH] cd_rm --- cd.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index 561dc0e..9445890 100644 --- a/cd.sh +++ b/cd.sh @@ -678,17 +678,16 @@ cd_openssl () { } cd_rm () { -local path="${1}" - if [ -e "${path}" ] ; then - echo "← ${path}" - rm -r "${path}" || exit + cd_rm__path="${1}" + if [ -e "${cd_rm__path}" ] ; then + echo "← ${cd_rm__path}" + rm -r "${cd_rm__path}" || exit fi } cd_sed () { cd_sed__file="${1}" shift - # if [ -f "${cd_sed__file}" ] ; then cd_cat "${cd_sed__file}" for cd_sed__regex in "${@}" ; do @@ -718,7 +717,6 @@ ${CD___UP}" cd_write () { cd_write__file="${1}" cd_write__text="${2}" - # if [ "${cd_write__file}" ] ; then [ -f "${cd_write__file}" ] && cd_cat "${cd_write__file}" echo "→ ${cd_write__file}"