aboutsummaryrefslogtreecommitdiff
path: root/tools/cpt-install
diff options
context:
space:
mode:
Diffstat (limited to 'tools/cpt-install')
-rwxr-xr-xtools/cpt-install4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/cpt-install b/tools/cpt-install
index 0fe2484..d99bfa6 100755
--- a/tools/cpt-install
+++ b/tools/cpt-install
@@ -4,8 +4,6 @@
# 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)
@@ -24,6 +22,8 @@ while [ "$1" ]; do
esac
done
+[ "$1" ] || set -- "${PWD##*/}"; export CPT_PATH=${PWD%/*}:$CPT_PATH
+
[ -w "$CPT_ROOT/" ] || [ "$uid" = 0 ] || {
as_root "$0" "$@"
exit $?