Skip to content

Commit d2000ac

Browse files
[deckhouse-cli] update default installation directory (#241)
Signed-off-by: Roman Berezkin <[email protected]>
1 parent e9f59d3 commit d2000ac

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tools/install.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ set -e
3232
# Default settings
3333
REPO=${REPO:-deckhouse/deckhouse-cli}
3434
VERSION=${VERSION:-latest}
35-
INSTALL_DIR=${INSTALL_DIR:-/usr/local/bin}
35+
INSTALL_DIR=${INSTALL_DIR:-/opt/deckhouse/bin}
3636
FORCE=${FORCE:-no}
3737
UNATTENDED=${UNATTENDED:-no}
3838
BINARY_NAME="d8"
@@ -410,14 +410,15 @@ verify_installation() {
410410
INSTALL_DIR="${INSTALL_DIR%/}"
411411
target_path="${INSTALL_DIR}/${BINARY_NAME}"
412412

413-
if ! command_exists "$BINARY_NAME" && [ ! -f "$target_path" ]; then
413+
fmt_info "Verifying installation..."
414+
415+
# Check if binary exists after installation
416+
if [ ! -f "$target_path" ]; then
414417
fmt_error "Installation verification failed"
415418
exit 1
416419
fi
417420

418-
fmt_info "Verifying installation..."
419-
420-
# Try to get version
421+
# Try to get version directly or using absolute path if not in PATH
421422
if command_exists "$BINARY_NAME"; then
422423
version_output=$("$BINARY_NAME" --version 2>/dev/null || echo "")
423424
if [ -n "$version_output" ]; then
@@ -429,8 +430,8 @@ verify_installation() {
429430
fmt_success "${version_output}"
430431
fi
431432
fi
432-
433-
# Check if binary is in PATH
433+
434+
# Suggest adding INSTALL_DIR to PATH for the user
434435
if ! command_exists "$BINARY_NAME"; then
435436
echo ""
436437
fmt_warn "Note: ${INSTALL_DIR} is not in your PATH"

0 commit comments

Comments
 (0)