@@ -47,7 +47,7 @@ DESCRIPTION:
47
47
USAGE:
48
48
./get-aspire-cli.sh [OPTIONS]
49
49
50
- -i, --install-path PATH Directory to install the CLI (default: $HOME/.aspire/bin )
50
+ -i, --install-path PATH Directory to install the CLI (default: $HOME/.aspire)
51
51
-q, --quality QUALITY Quality to download (default: ${DEFAULT_QUALITY}). Supported values: dev, staging, release
52
52
--version VERSION Version of the Aspire CLI to download (default: unset)
53
53
--os OS Operating system (default: auto-detect)
@@ -458,7 +458,6 @@ validate_checksum() {
458
458
install_archive () {
459
459
local archive_file=" $1 "
460
460
local destination_path=" $2 "
461
- local os=" $3 "
462
461
463
462
if [[ " $DRY_RUN " == true ]]; then
464
463
say_info " [DRY RUN] Would install archive $archive_file to $destination_path "
@@ -473,28 +472,27 @@ install_archive() {
473
472
mkdir -p " $destination_path "
474
473
fi
475
474
476
- if [[ " $os " == " win" ]]; then
477
- # Use unzip for ZIP files
475
+ if [[ " $archive_file " =~ \. zip$ ]]; then
478
476
if ! command -v unzip > /dev/null 2>&1 ; then
479
477
say_error " unzip command not found. Please install unzip to extract ZIP files."
480
478
return 1
481
479
fi
482
-
483
480
if ! unzip -o " $archive_file " -d " $destination_path " ; then
484
481
say_error " Failed to extract ZIP archive: $archive_file "
485
482
return 1
486
483
fi
487
- else
488
- # Use tar for tar.gz files on Unix systems
484
+ elif [[ " $archive_file " =~ \. tar\. gz$ ]]; then
489
485
if ! command -v tar > /dev/null 2>&1 ; then
490
486
say_error " tar command not found. Please install tar to extract tar.gz files."
491
487
return 1
492
488
fi
493
-
494
489
if ! tar -xzf " $archive_file " -C " $destination_path " ; then
495
490
say_error " Failed to extract tar.gz archive: $archive_file "
496
491
return 1
497
492
fi
493
+ else
494
+ say_error " Unsupported archive format: $archive_file . Only .zip and .tar.gz files are supported."
495
+ return 1
498
496
fi
499
497
500
498
say_verbose " Successfully installed archive"
@@ -715,7 +713,7 @@ download_and_install_archive() {
715
713
fi
716
714
717
715
# Install the archive
718
- if ! install_archive " $filename " " $INSTALL_PATH " " $os " ; then
716
+ if ! install_archive " $filename " " $INSTALL_PATH " ; then
719
717
return 1
720
718
fi
721
719
752
750
753
751
# Set default install path if not provided
754
752
if [[ -z " $INSTALL_PATH " ]]; then
755
- INSTALL_PATH=" $HOME /.aspire/bin "
756
- INSTALL_PATH_UNEXPANDED=" \$ HOME/.aspire/bin "
753
+ INSTALL_PATH=" $HOME /.aspire"
754
+ INSTALL_PATH_UNEXPANDED=" \$ HOME/.aspire"
757
755
else
758
756
INSTALL_PATH_UNEXPANDED=" $INSTALL_PATH "
759
757
fi
0 commit comments