Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,25 @@ permissions:
statuses: write

jobs:
test-install-using-action:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Cloud Runtime CLI
uses: ./
- 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
build-and-test:
runs-on: macos-latest
env:
Expand Down
39 changes: 23 additions & 16 deletions script/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading