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
12 changes: 5 additions & 7 deletions test-template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,16 @@ fi
test_name="test-package-$hosting_provider"
test_dir="$(pwd)/_temp/$is_seedcase_project/$test_name"
template_dir="$(pwd)"
# Use the latest commit for the template
commit=$(git rev-parse HEAD)

# Needs three arguments:
#
# 1. Template directory
# 2. Destination directory
# 3. VCS ref (commit, branch, tag, etc.)
copy () {
# vcs-ref means the current commit/head, not a tag.
# `-r HEAD` means to copy from the current HEAD, including uncommitted changes
uvx copier copy $1 $2 \
--vcs-ref=$3 \
-r HEAD \
--defaults \
--data is_seedcase_project=$is_seedcase_project \
--data github_user="first-last" \
Expand All @@ -56,7 +54,7 @@ mkdir -p $test_dir
echo "Testing copy for new projects when: 'is_seedcase_project'='$is_seedcase_project', 'hosting_provider'='$hosting_provider' -----------"
(
cd $test_dir &&
copy $template_dir $test_dir $commit &&
copy $template_dir $test_dir &&
git init -b main &&
git add . &&
git commit --quiet -m "test: initial copy" &&
Expand All @@ -66,7 +64,7 @@ echo "Testing copy for new projects when: 'is_seedcase_project'='$is_seedcase_pr
git add . &&
git commit --quiet -m "test: preparing to recopy from the template" &&
uvx copier recopy \
--vcs-ref=$commit \
-r HEAD \
--defaults \
--overwrite \
--skip-tasks \
Expand All @@ -76,7 +74,7 @@ echo "Testing copy for new projects when: 'is_seedcase_project'='$is_seedcase_pr
rm .cz.toml .copier-answers.yml &&
git add . &&
git commit --quiet -m "test: preparing to copy onto an existing package" &&
copy $template_dir $test_dir $commit #&&
copy $template_dir $test_dir #&&
# Checks and builds -----
# just run-all
)
Loading