diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/cpt-install | 3 | ||||
-rwxr-xr-x | tools/cpt-remove | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/tools/cpt-install b/tools/cpt-install index d74085f..0fe2484 100755 --- a/tools/cpt-install +++ b/tools/cpt-install @@ -4,6 +4,8 @@ # shellcheck disable=1091 if command -v cpt-lib >/dev/null; then . cpt-lib; else . ../lib.sh; fi +[ "$1" ] || set -- "${PWD##*/}"; export CPT_PATH=${PWD%/*}:$CPT_PATH + while [ "$1" ]; do case "$1" in --help|-h) @@ -18,7 +20,6 @@ while [ "$1" ]; do --root) export CPT_ROOT=$2; shift 2 ;; --) break ;; -*) die "Unknown argument '$1'" ;; - '') set -- "${PWD##*/}"; export CPT_PATH=${PWD%/*}:$CPT_PATH ;; *) break ;; esac done diff --git a/tools/cpt-remove b/tools/cpt-remove index 803fd36..543f8b8 100755 --- a/tools/cpt-remove +++ b/tools/cpt-remove @@ -4,6 +4,8 @@ # shellcheck disable=1091 if command -v cpt-lib >/dev/null; then . cpt-lib; else . ../lib.sh; fi +[ "$1" ] || set -- "${PWD##*/}"; export CPT_PATH=${PWD%/*}:$CPT_PATH + while [ "$1" ]; do case "$1" in --help|-h) @@ -18,7 +20,6 @@ while [ "$1" ]; do --root) export CPT_ROOT=$2; shift 2 ;; --) break ;; -*) die "Unknown argument '$1'" ;; - '') set -- "${PWD##*/}"; export CPT_PATH=${PWD%/*}:$CPT_PATH ;; *) break ;; esac done |