Skip to content

build: ensure no permission errors thrown in packages-dist script #17566

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

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
8 changes: 7 additions & 1 deletion scripts/build-packages-dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ dirs=`echo "$targets" | sed -e 's/\/\/src\/\(.*\):npm_package/\1/'`
# do this to ensure that the version placeholders are properly populated.
for pkg in ${dirs}; do
pkg_dir="${bazel_bin_path}/src/${pkg}/npm_package"
rm -Rf ${pkg_dir}
if [[ -d ${pkg_dir} ]]; then
# Make all directories in the previous package output writable. Bazel by default
# makes tree artifacts and file outputs readonly. This causes permission errors
# when deleting the folder. To avoid these errors, we make all files writable.
chmod -R u+w ${pkg_dir}
rm -Rf ${pkg_dir}
fi
done

# Walk through each release package target and build it.
Expand Down