Skip to content

Commit

Permalink
Release 0.62.0 (2024-05-10)
Browse files Browse the repository at this point in the history
### Features

* Add --dir flag to normalize-dist

Bug: b/339407401
Change-Id: I3038aad94327edd2a51c5b909ca727362d1bb16d
GitOrigin-RevId: bcec63e6c845816d3b5b5030f5a9b92aefecea5b
  • Loading branch information
Privacy Sandbox Team authored and pmeric committed May 10, 2024
1 parent 333094f commit fe7a763
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 13 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.

## 0.62.0 (2024-05-10)


### Features

* Add --dir flag to normalize-dist

## 0.61.1 (2024-05-10)


Expand Down
47 changes: 35 additions & 12 deletions tools/normalize-dist
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,40 @@
set -o pipefail
set -o errexit

declare TOP_LEVEL_DIR=dist

function usage() {
local exitval=${1-1}
cat &>/dev/stderr <<USAGE
usage:
$0 <options>
--dir <path> directory to normalize recursively. Default: ${TOP_LEVEL_DIR}
USAGE
# shellcheck disable=SC2086
exit ${exitval}
}

while [[ $# -gt 0 ]]; do
case "$1" in
--dir)
TOP_LEVEL_DIR="$2"
shift 2 || usage
;;
-h | --help) usage 0 ;;
*)
printf "unrecognized arg: %s\n" "$1"
usage
;;
esac
done

trap _cleanup EXIT
function _cleanup() {
local -r -i STATUS=$?
if [[ ${STATUS} -eq 0 ]]; then
printf "normalize-dist completed successfully\n" &>/dev/stderr
printf "normalize-dist [%s] completed successfully\n" "${TOP_LEVEL_DIR}" &>/dev/stderr
else
printf "Error: normalize-dist completed with status code: %s\n" "${STATUS}" &>/dev/stderr
printf "Error: normalize-dist [%s] completed with status code: %s\n" "${TOP_LEVEL_DIR}" "${STATUS}" &>/dev/stderr
fi
exit 0
}
Expand All @@ -40,9 +67,7 @@ readonly GROUP
USER="$(builder::id u)"
readonly USER

readonly TOP_LEVEL_DIRS="dist"

printf "Setting file ownership [%s], group [%s] in dirs [%s]\n" "${USER}" "${GROUP}" "${TOP_LEVEL_DIRS}"
printf "Setting file ownership [%s], group [%s] in dirs [%s]\n" "${USER}" "${GROUP}" "${TOP_LEVEL_DIR}"
declare -a runner=()
if [[ -f /.dockerenv ]]; then
runner+=(bash -c)
Expand All @@ -51,11 +76,9 @@ else
fi

"${runner[@]}" "
for TOP_LEVEL_DIR in ${TOP_LEVEL_DIRS}; do
find \${TOP_LEVEL_DIR} -type f ! -executable -exec chmod 644 {} \;
find \${TOP_LEVEL_DIR} -type f -executable -exec chmod 755 {} \;
find \${TOP_LEVEL_DIR} -type d -exec chmod 755 {} \;
chgrp --recursive ${GROUP} \${TOP_LEVEL_DIR}
chown --recursive ${USER} \${TOP_LEVEL_DIR}
done
find ${TOP_LEVEL_DIR} -type f ! -executable -exec chmod 644 {} \;
find ${TOP_LEVEL_DIR} -type f -executable -exec chmod 755 {} \;
find ${TOP_LEVEL_DIR} -type d -exec chmod 755 {} \;
chgrp --recursive ${GROUP} ${TOP_LEVEL_DIR}
chown --recursive ${USER} ${TOP_LEVEL_DIR}
"
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.61.1
0.62.0

0 comments on commit fe7a763

Please sign in to comment.