Skip to content
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: 8 additions & 2 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,14 @@ function yorn() {

function display_version() {
echo -n "Docker Host version $version build "
find "$dir" -type f \( -name '*.sh' -o -name '*.yml' \) -not -path '*/node_modules/*' | \
sort | xargs cat | sha256sum | cut -c1-8
# To calculate a build hash, we hash all of the sorted files according to these rules:
# - Exclude node_modules, exp, and hidden files/directories (using -prune)
# - Include symlinks, both files (-type f and -type l) and directories (-L)
# - Include only .sh and .yml files
find -L "$dir" \
\( -path '*/node_modules' -o -path '*/exp' -o -path '*/.*' \) -prune -o \
\( \( -type f -o -type l \) -a \( -name '*.sh' -o -name '*.yml' \) \) -print0 | \
LC_ALL=C sort -z | xargs -0 cat | sha256sum | cut -c1-8
}

# Title for the script
Expand Down