Add --version flag to install.sh to install a specific GitHub release#659
Conversation
Agent-Logs-Url: https://github.com/version-fox/vfox/sessions/6ab6e3d5-ea72-4885-8cbd-5dd3cc02dcbd Co-authored-by: bytemain <13938334+bytemain@users.noreply.github.com>
|
@aooohan 以前用的旧版本的 vfox 做 CI 里安装 node 的基建,最近发现更新新版 1.0.10 之后 CI 挂了,没太研究是怎么挂的,先把 CI 能力恢复一下 |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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.shargument parsing to support--version <v>/--version=<v>(leadingvoptional). - Fetch release metadata from
releases/tags/v{version}when--versionis provided (otherwise use/latest). - Document
--versionusage 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.
| --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 |
There was a problem hiding this comment.
--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.
install.shalways installs the latest release. Add a--versionflag so users can pin to any published GitHub release.Changes
install.sh: New--version <v>/--version=<v>flag (leadingvoptional). When set, the script queriesreleases/tags/v{version}instead of/latestand surfaces a clear error if the tag does not exist. Arg parsing converted from afor argloop to awhileloop so flags can take values and be combined in any order.docs/guides/quick-start.mdanddocs/zh-hans/guides/quick-start.md: Document the new flag in EN and zh-Hans.Usage