Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web: Ignore .swc directory when computing web SHA #29892

Merged
merged 1 commit into from
Aug 2, 2023
Merged
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
10 changes: 7 additions & 3 deletions build.assets/build-webassets-if-changed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ for i in "${!SRC_DIRECTORIES[@]}"; do
done

function calculate_sha() {
#shellcheck disable=SC2005,SC2086
echo "$(find "${SRC_DIRECTORIES[@]}" "$ROOT_PATH/package.json" "$ROOT_PATH/yarn.lock" -not \( -type d -name node_modules -prune \) -type f -print0 | LC_ALL=C sort -z | xargs -0 $SHASUM | awk '{print $1}' | $SHASUM | tr -d ' -')"
#shellcheck disable=SC2086
#We want to split $SHASUM on spaces so we dont want it quoted.
find "${SRC_DIRECTORIES[@]}" "$ROOT_PATH/package.json" "$ROOT_PATH/yarn.lock" \
-not \( -type d \( -name node_modules -o -name .swc \) -prune \) \
-type f -print0 | \
LC_ALL=C sort -z | xargs -0 $SHASUM | awk '{print $1}' | $SHASUM | tr -d ' -'
}

# Calculate the current hash-of-hashes of the given source directories. Adds in package.json as well.
Expand All @@ -79,7 +83,7 @@ if [ "$BUILD" = "true" ]; then \
# updated by the build process.
mkdir -p "$(dirname "$LAST_SHA_FILE")"
# Save SHA with yarn.lock before yarn install
echo $CURRENT_SHA > "$LAST_SHA_FILE"
echo "$CURRENT_SHA" > "$LAST_SHA_FILE"
echo "$TYPE webassets successfully updated."
else
echo "$TYPE webassets up to date."
Expand Down
Loading