Skip to content

Commit

Permalink
Ignore .storybook in build-webassets-if-changed.sh (#46016)
Browse files Browse the repository at this point in the history
  • Loading branch information
ravicious authored Aug 29, 2024
1 parent cf9c0b8 commit 1f3fd3e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions build.assets/build-webassets-if-changed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,18 @@ for i in "${!SRC_DIRECTORIES[@]}"; do
done

# Calculate the current hash-of-hashes of the given source directories, package.json, and pnpm-lock.yaml.
# We exclude node_modules as it's covered by package.json and pnpm-lock.yaml.
# We also exclude .swc as it's a cache directory for the swc compiler,
# and ironrdp/pkg as it's filled with the generated wasm files.
# Excluded files and folders:
# * node_modules: it's covered by package.json and pnpm-lock.yaml.
# * .swc: it's a cache directory for the swc compiler.
# * ironrdp/pkg: it's filled with the generated wasm files.
# * web/.storybook: it contains public/mockServiceWorker.js which is autogenerated
# on `pnpm install` & `pnpm storybook`. Not ignoring it would cause issues for build pipelines
# that depend on the release-unix-preserving-webassets Make target.
function calculate_sha() {
#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/pnpm-lock.yaml" \
-not \( -type d \( -name node_modules -o -name .swc -o -path '*ironrdp/pkg*' \) -prune \) \
-not \( -type d \( -name node_modules -o -name .swc -o -path '*ironrdp/pkg*' -o -name .storybook \) -prune \) \
-type f -print0 | \
LC_ALL=C sort -z | xargs -0 $SHASUM | awk '{print $1}' | $SHASUM | tr -d ' -'
}
Expand Down

0 comments on commit 1f3fd3e

Please sign in to comment.