mirror of
https://github.com/qlik-oss/PLSmartPivot.git
synced 2025-12-19 18:27:32 -05:00
-Part of the work to streamline how the extensions are handled, irregardless of what bundle. Issue: DEB-130, DEB-133
26 lines
739 B
Bash
26 lines
739 B
Bash
#!/bin/bash
|
|
# The build script has a known race-condition that sometimes causes it to not include all files
|
|
# in the built zip. This script verifies the that the zip contains the correct number of files.
|
|
|
|
set -o errexit
|
|
|
|
echo "Verifying built file count"
|
|
|
|
while read line; do
|
|
if [[ $line =~ ^\"name\": ]]; then
|
|
name=${line#*: \"}
|
|
name=${name%\"*}
|
|
fi
|
|
done < package.json
|
|
|
|
expected_file_count=$(($(find dist -type f | wc -l)-1))
|
|
zip_file_count=$(zipinfo dist/${name}_${VERSION}.zip | grep ^- | wc -l)
|
|
|
|
if [ "${expected_file_count}" -ne "${zip_file_count}" ]; then
|
|
# File count is incorrect
|
|
echo "Expected file count ${expected_file_count}, but was ${zip_file_count}"
|
|
exit 1
|
|
fi
|
|
echo "File count OK"
|
|
exit 0
|