Skip to content

Commit 9d2b3b6

Browse files
committed
Edit publish.sh -- avoiding more directories when calculating checksum
1 parent 2bc6e70 commit 9d2b3b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

publish.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ function setup_artifacts_bucket() {
144144
function calculate_hash() {
145145
local directory_path=$1
146146
local HASH=$(
147-
find "$directory_path" \( -name "node_modules" -o -name "build" -o -name ".aws-sam" \) -prune -o -type f -print0 |
147+
find "$directory_path" \( -name "node_modules" -o -name "build" -o -name ".aws-sam" -o -name "venv" -o -name ".venv" -o -name ".git" -o -name "__pycache__" -o -name ".pytest_cache" -o -name "dist" -o -name "*.egg-info" \) -prune -o -type f -print0 |
148148
sort -f -z |
149149
xargs -0 sha256sum |
150150
sha256sum |
@@ -161,7 +161,7 @@ function calculate_hash() {
161161
# Calculate directory checksum
162162
function get_dir_checksum() {
163163
local dir=$1
164-
local dir_checksum=$(find "$dir" -type d \( -name "python" -o -name "node_modules" -o -name "build" -o -name ".aws-sam" -o -name "dist" -o -name "__pycache__" -o -name ".pytest_cache" -o -name "*.egg-info" \) -prune -o -type f \( ! -name ".checksum" -a ! -name "*.pyc" \) -exec $STAT_CMD {} \; | sha256sum | awk '{ print $1 }')
164+
local dir_checksum=$(find "$dir" -type d \( -name "python" -o -name "node_modules" -o -name "build" -o -name ".aws-sam" -o -name "dist" -o -name "__pycache__" -o -name ".pytest_cache" -o -name "*.egg-info" -o -name "venv" -o -name ".venv" -o -name ".git" \) -prune -o -type f \( ! -name ".checksum" -a ! -name "*.pyc" \) -exec $STAT_CMD {} \; | sha256sum | awk '{ print $1 }')
165165
local combined_string="$BUCKET $PREFIX_AND_VERSION $REGION $dir_checksum"
166166
echo -n "$combined_string" | sha256sum | awk '{ print $1 }'
167167
}

0 commit comments

Comments
 (0)