Add script to update the SHA and rebuild in one step.#316
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
Adds a helper script to fetch the latest vcpkg commit SHA and rebuild in one step, aligns URL casing, and updates documentation.
- Introduce
updateAndRebuild.shfor combined SHA update and rebuild - Standardize GitHub URL casing and fix shebangs in existing scripts
- Update README to reference the new script
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| scripts/updateAndRebuild.sh | New script to fetch the master branch SHA and run rebuild |
| scripts/syncMetadata.sh | Fixed shebang typo and unified repo URL casing |
| scripts/rebuild.sh | Corrected shebang, updated repo URL casing |
| README.md | Added instructions for using updateAndRebuild.sh |
Comments suppressed due to low confidence (3)
scripts/syncMetadata.sh:7
- Wrap the
$repo_urlvariable in quotes ("$repo_url") when callinggit ls-remoteto prevent potential word-splitting if the URL ever contains special characters.
(git ls-remote $repo_url | head -n1 | awk '{ print $1 }') > commit.txt
scripts/rebuild.sh:7
- Move the existence check for
commit.txt(if [ ! -e commit.txt ]; then exit 1; fi) before reading it to avoid assigning an empty string and improve error clarity.
vcpkg_commit=$(cat commit.txt)
README.md:14
- [nitpick] Consider replacing "Alternately" with "Alternatively" for smoother wording, and wrap the URL in
<...>or backticks for consistency.
The `rebuild.sh` script can be modified to build a specific commit in this repository. Alternately, use `updateAndRebuild.sh` to use the current commit on https://github.com/microsoft/vcpkg 's master branch.
| set -e | ||
|
|
||
| cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" | ||
| git ls-remote https://github.com/microsoft/vcpkg master | sed -nE 's/^([0-9a-f]+)\t[^\n]*$/\1/p' > commit.txt |
There was a problem hiding this comment.
[nitpick] Consider extracting the repo URL into a variable (e.g. repo_url) or sourcing it from a shared config to avoid hard-coding the URL in multiple places.
Suggested change
| git ls-remote https://github.com/microsoft/vcpkg master | sed -nE 's/^([0-9a-f]+)\t[^\n]*$/\1/p' > commit.txt | |
| repo_url="https://github.com/microsoft/vcpkg" | |
| git ls-remote "$repo_url" master | sed -nE 's/^([0-9a-f]+)\t[^\n]*$/\1/p' > commit.txt |
vicroms
approved these changes
Jun 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.