Skip to content

Add --version flag to install.sh to install a specific GitHub release#659

Merged
bytemain merged 1 commit into
mainfrom
copilot/add-version-install-feature
Apr 22, 2026
Merged

Add --version flag to install.sh to install a specific GitHub release#659
bytemain merged 1 commit into
mainfrom
copilot/add-version-install-feature

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 22, 2026

install.sh always installs the latest release. Add a --version flag so users can pin to any published GitHub release.

Changes

  • install.sh: New --version <v> / --version=<v> flag (leading v optional). When set, the script queries releases/tags/v{version} instead of /latest and surfaces a clear error if the tag does not exist. Arg parsing converted from a for arg loop to a while loop so flags can take values and be combined in any order.
  • docs/guides/quick-start.md and docs/zh-hans/guides/quick-start.md: Document the new flag in EN and zh-Hans.

Usage

# Latest (unchanged)
curl -sSL https://raw.githubusercontent.com/version-fox/vfox/main/install.sh | bash

# Specific version
curl -sSL https://raw.githubusercontent.com/version-fox/vfox/main/install.sh | bash -s -- --version 0.5.6

# Combined with --user
curl -sSL https://raw.githubusercontent.com/version-fox/vfox/main/install.sh | bash -s -- --user --version v0.5.6

@bytemain
Copy link
Copy Markdown
Member

@aooohan 以前用的旧版本的 vfox 做 CI 里安装 node 的基建,最近发现更新新版 1.0.10 之后 CI 挂了,没太研究是怎么挂的,先把 CI 能力恢复一下

@bytemain bytemain marked this pull request as ready for review April 22, 2026 17:44
Copilot AI review requested due to automatic review settings April 22, 2026 17:44
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 24.09%. Comparing base (9522202) to head (f3518a7).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #659      +/-   ##
==========================================
- Coverage   25.03%   24.09%   -0.95%     
==========================================
  Files          82       82              
  Lines        5667     7084    +1417     
==========================================
+ Hits         1419     1707     +288     
- Misses       4072     5201    +1129     
  Partials      176      176              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bytemain bytemain merged commit 4b5c932 into main Apr 22, 2026
10 of 11 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for installing a pinned vfox GitHub Release via install.sh, and documents the new capability in the Quick Start guides.

Changes:

  • Extend install.sh argument parsing to support --version <v> / --version=<v> (leading v optional).
  • Fetch release metadata from releases/tags/v{version} when --version is provided (otherwise use /latest).
  • Document --version usage in EN and zh-Hans quick start guides.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
install.sh Adds --version flag parsing and tag-based GitHub release lookup.
docs/guides/quick-start.md Documents installing a specific version via --version.
docs/zh-hans/guides/quick-start.md Same documentation update in zh-Hans.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread install.sh
Comment on lines +13 to +19
--version)
if [ -z "$2" ]; then
echo "Error: --version requires a value (e.g. --version 0.5.6 or --version v0.5.6)"
exit 1
fi
VERSION="$2"
shift 2
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--version only checks whether $2 is empty. If the next token is another flag (e.g. --version --user), this will incorrectly treat --user as the version and proceed with a bad API request. Consider treating a missing value as either $2 being empty or $2 starting with -, and error out in that case.

Copilot uses AI. Check for mistakes.
Comment thread install.sh
Comment thread install.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants