Skip to content

Commit

Permalink
Merge pull request yegor256#366 from Raleksan/master
Browse files Browse the repository at this point in the history
yegor256#308 put CaM sources into zip archive
  • Loading branch information
yegor256 authored Sep 26, 2024
2 parents f20bced + b811ded commit 8209166
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
7 changes: 7 additions & 0 deletions steps/zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ if [ -e "${zip}" ]; then
exit
fi

cam_repo_target_dir="${TARGET}/cam-sources"

if [ ! -d "${cam_repo_target_dir}" ]; then
git clone --depth 1 https://github.com/yegor256/cam.git "${cam_repo_target_dir}"
rm -rf "${cam_repo_target_dir}/.git"
fi

if [ -e "${TARGET}/github" ]; then
echo "Deleting .git directories (may take some time) ..."
find "${TARGET}/github" -maxdepth 3 -mindepth 3 -type d -name '.git' -exec rm -rf {} \;
Expand Down
2 changes: 1 addition & 1 deletion tests/after/test-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ stdout=$2
for f in start.txt hashes.csv report.pdf repositories.csv; do
test -f "${TARGET}/${f}"
done
test "$(find "${TARGET}" -maxdepth 1 | wc -l | xargs)" = 10
test "$(find "${TARGET}" -maxdepth 1 | wc -l | xargs)" = 11
test -f "${TARGET}/data/${repo}/NCSS.csv"
test -f "${TARGET}/data/${repo}/NHD.csv"
test -f "${TARGET}/data/${repo}/SCOM-cvc.csv"
Expand Down
10 changes: 10 additions & 0 deletions tests/steps/test-zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ stdout=$2
} > "${stdout}" 2>&1
echo "👍🏻 A zip archive generated correctly"

{
mkdir -p "${TARGET}/something"
zip=${TARGET}/cam-$(date +%Y-%m-%d).zip
"${LOCAL}/steps/zip.sh"
list=$(unzip -l "${zip}")
echo "${list}" | grep "cam-sources/" > /dev/null
echo "${list}" | grep --invert-match "cam-sources/.git" > /dev/null
} > "${stdout}" 2>&1
echo "👍🏻 A zip archive contains the CaM repository (without .git)"

{
mkdir -p "${TARGET}/measurements/a/b/baam.m.cloc"
mkdir -p "${TARGET}/temp/a/b/hello.txt"
Expand Down

0 comments on commit 8209166

Please sign in to comment.