File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,6 +46,33 @@ checksum_tree() {
4646 ) > " $output "
4747}
4848
49+ file_mtime () {
50+ if stat -f %m " $1 " > /dev/null 2>&1 ; then
51+ stat -f %m " $1 "
52+ else
53+ stat -c %Y " $1 "
54+ fi
55+ }
56+
57+ latest_file () {
58+ local root=$1
59+ local pattern=$2
60+ local latest=
61+ local latest_mtime=0
62+ local candidate
63+ local candidate_mtime
64+
65+ while IFS= read -r -d ' ' candidate; do
66+ candidate_mtime=$( file_mtime " $candidate " )
67+ if [[ -z " $latest " || " $candidate_mtime " -gt " $latest_mtime " ]]; then
68+ latest=$candidate
69+ latest_mtime=$candidate_mtime
70+ fi
71+ done < <( find " $root " -type f -name " $pattern " -print0)
72+
73+ printf ' %s\n' " $latest "
74+ }
75+
4976download_bundletool () {
5077 if [[ -f " $bundletool_jar " ]]; then
5178 local actual
93120
94121aab_path=${AAB_PATH:- }
95122if [[ -z " $aab_path " ]]; then
96- aab_path=$( find app/build/outputs/bundle/mainnetRelease -name ' bitkit-mainnet-release-*.aab' | LC_ALL=C sort | tail -n 1 )
123+ aab_path=$( latest_file app/build/outputs/bundle/mainnetRelease ' bitkit-mainnet-release-*.aab' )
97124fi
98125if [[ ! -f " $aab_path " ]]; then
99126 echo " AAB not found. Set AAB_PATH or run bundleMainnetRelease first." >&2
@@ -153,4 +180,3 @@ Bundletool: $bundletool_version
153180EOF
154181
155182echo " Wrote reproducibility artifacts to '$output_dir '."
156-
You can’t perform that action at this time.
0 commit comments