From 273b874d23ec4fcf2b463ae135ae8e39377b1b75 Mon Sep 17 00:00:00 2001 From: Gorka Revilla Date: Fri, 7 Nov 2025 15:22:05 +0100 Subject: [PATCH 1/7] fix: POSIX compatible script to install --- .github/workflows/ci.yml | 14 ++++++++++++++ script/install.sh | 39 +++++++++++++++++++++++---------------- 2 files changed, 37 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 34c38f6..d7a7f27 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,20 @@ permissions: statuses: write jobs: + test-install-using-action: + runs-on: ubuntu-latest + steps: + - name: Install Cloud Runtime CLI + uses: ./.github/actions/install-cloud-runtime-cli + - name: Verify installation + run: vcr --version + test-install-using-script: + runs-on: ubuntu-latest + steps: + - name: Install Cloud Runtime CLI + run: ./script/install.sh | sh + - name: Verify installation + run: vcr --version build-and-test: runs-on: macos-latest env: diff --git a/script/install.sh b/script/install.sh index 7be85aa..3ac563a 100755 --- a/script/install.sh +++ b/script/install.sh @@ -125,26 +125,33 @@ main() { # If system-wide fails, try user-local directories user_local_paths="$HOME/.local/bin:$HOME/bin:$HOME/.vcr/bin" - IFS=':' read -ra paths <<< "$user_local_paths" - for user_path in "${paths[@]}"; do + oldIFS=$IFS + IFS=: + set -- $user_local_paths + IFS=$oldIFS + + for user_path do if mkdir -p "$user_path" 2>/dev/null && mv "$tmp_dir/${vcr_binary}" "$user_path/vcr" 2>/dev/null; then echo "vcr was installed successfully to $user_path" # Check if the path is already in PATH - if ! echo ":$PATH:" | grep -q ":$user_path:"; then - case $SHELL in - /bin/zsh) shell_profile=".zshrc" ;; - *) shell_profile=".bash_profile" ;; - esac - echo "" - echo "⚠️ Warning: $user_path is not in your \$PATH" - echo "Add the following to your \$HOME/$shell_profile:" - echo " export PATH=\"$user_path:\$PATH\"" - echo "" - echo "Then you can run: vcr --help" - else - echo "Run 'vcr --help' to get started" - fi + case ":$PATH:" in + *":$user_path:"*) + echo "Run 'vcr --help' to get started" + ;; + *) + case $SHELL in + /bin/zsh) shell_profile=".zshrc" ;; + *) shell_profile=".bash_profile" ;; + esac + echo "" + echo "⚠️ Warning: $user_path is not in your \$PATH" + echo "Add the following to your \$HOME/$shell_profile:" + echo " export PATH=\"$user_path:\$PATH\"" + echo "" + echo "Then you can run: vcr --help" + ;; + esac exit 0 fi done From 20c0bbfadc3415e6ecab600c5cecd40569822ca6 Mon Sep 17 00:00:00 2001 From: Gorka Revilla Date: Fri, 7 Nov 2025 15:25:36 +0100 Subject: [PATCH 2/7] fix: action --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7a7f27..3a11998 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,14 +26,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Cloud Runtime CLI - uses: ./.github/actions/install-cloud-runtime-cli + uses: ./action.yml - name: Verify installation run: vcr --version test-install-using-script: runs-on: ubuntu-latest steps: - name: Install Cloud Runtime CLI - run: ./script/install.sh | sh + shell: sh + run: ./script/install.sh - name: Verify installation run: vcr --version build-and-test: From 29872838f805c8851578cbe68eaca26032d0eea7 Mon Sep 17 00:00:00 2001 From: Gorka Revilla Date: Fri, 7 Nov 2025 15:27:18 +0100 Subject: [PATCH 3/7] fix: clone repo --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a11998..505628a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,8 @@ jobs: test-install-using-action: runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v4 - name: Install Cloud Runtime CLI uses: ./action.yml - name: Verify installation @@ -32,6 +34,8 @@ jobs: test-install-using-script: runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v4 - name: Install Cloud Runtime CLI shell: sh run: ./script/install.sh From 00009adec8ea4204bba44d107c8d733d7517ca6c Mon Sep 17 00:00:00 2001 From: Gorka Revilla Date: Fri, 7 Nov 2025 15:30:05 +0100 Subject: [PATCH 4/7] fix: action --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 505628a..565fdaf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - name: Install Cloud Runtime CLI - uses: ./action.yml + uses: ./ - name: Verify installation run: vcr --version test-install-using-script: From 6309e9838417a0fe2d9f3029be9f4d1d3d705199 Mon Sep 17 00:00:00 2001 From: Gorka Revilla Date: Fri, 7 Nov 2025 15:31:25 +0100 Subject: [PATCH 5/7] test: this branch --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 8e436ca..7377656 100644 --- a/action.yml +++ b/action.yml @@ -15,9 +15,9 @@ runs: run: | VERSION="${{ inputs.version }}" if [ "$VERSION" == "main" ]; then - curl -L "https://raw.githubusercontent.com/Vonage/cloud-runtime-cli/main/script/install.sh" | sudo sh + curl -L "https://raw.githubusercontent.com/Vonage/cloud-runtime-cli/fix/sh_shell/script/install.sh" | sudo sh else - curl -L "https://raw.githubusercontent.com/Vonage/cloud-runtime-cli/main/script/install.sh" | sudo sh -s -- "${VERSION}" + curl -L "https://raw.githubusercontent.com/Vonage/cloud-runtime-cli/fix/sh_shell/script/install.sh" | sudo sh -s -- "${VERSION}" fi # Verify installation From 9b33367a4f56c84f86456b86797e71f36d95ce1c Mon Sep 17 00:00:00 2001 From: Gorka Revilla Date: Fri, 7 Nov 2025 15:32:25 +0100 Subject: [PATCH 6/7] test: revert test branch --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 7377656..8e436ca 100644 --- a/action.yml +++ b/action.yml @@ -15,9 +15,9 @@ runs: run: | VERSION="${{ inputs.version }}" if [ "$VERSION" == "main" ]; then - curl -L "https://raw.githubusercontent.com/Vonage/cloud-runtime-cli/fix/sh_shell/script/install.sh" | sudo sh + curl -L "https://raw.githubusercontent.com/Vonage/cloud-runtime-cli/main/script/install.sh" | sudo sh else - curl -L "https://raw.githubusercontent.com/Vonage/cloud-runtime-cli/fix/sh_shell/script/install.sh" | sudo sh -s -- "${VERSION}" + curl -L "https://raw.githubusercontent.com/Vonage/cloud-runtime-cli/main/script/install.sh" | sudo sh -s -- "${VERSION}" fi # Verify installation From 6c9557309aca628f61cfcd7eb64615be5f94a0d2 Mon Sep 17 00:00:00 2001 From: Gorka Revilla Date: Fri, 7 Nov 2025 15:40:52 +0100 Subject: [PATCH 7/7] fix: tabs --- .github/workflows/ci.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 565fdaf..af1d9e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,15 +32,15 @@ jobs: - name: Verify installation run: vcr --version test-install-using-script: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Install Cloud Runtime CLI - shell: sh - run: ./script/install.sh - - name: Verify installation - run: vcr --version + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Install Cloud Runtime CLI + shell: sh + run: ./script/install.sh + - name: Verify installation + run: vcr --version build-and-test: runs-on: macos-latest env: