Skip to content

Add script to update the SHA and rebuild in one step.#316

Merged
BillyONeal merged 4 commits into
vcpkg:mainfrom
BillyONeal:update-and-rebuild
Jun 9, 2025
Merged

Add script to update the SHA and rebuild in one step.#316
BillyONeal merged 4 commits into
vcpkg:mainfrom
BillyONeal:update-and-rebuild

Conversation

@BillyONeal

Copy link
Copy Markdown
Member

No description provided.

This comment was marked as outdated.

@BillyONeal BillyONeal requested a review from Copilot June 9, 2025 19:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.sh for 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_url variable in quotes ("$repo_url") when calling git ls-remote to 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

Copilot AI Jun 9, 2025

Copy link

Choose a reason for hiding this comment

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

[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

Copilot uses AI. Check for mistakes.
@BillyONeal BillyONeal merged commit 26f1bda into vcpkg:main Jun 9, 2025
1 check passed
@BillyONeal BillyONeal deleted the update-and-rebuild branch June 9, 2025 20:48
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.

4 participants