Skip to content

Commit

Permalink
ci: Cross-platform file regex replace
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Nov 14, 2023
1 parent 8c3b386 commit 02112bf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ echo " TESTING PROJECT"
echo "///////////////////////////////////////////"
echo
echo ">>> Creating initial commit (feat)"
sed -Ei 's/(_commit: [^-]+)-.*$/\1/' .copier-answers.yml
python <<EOF
import re
with open(".copier-answers.yml") as file:
answers = file.read()
with open(".copier-answers.yml", "w") as file:
file.write(re.sub(r"(_commit: [^-]+)-.*", r"\1", answers))
EOF
git add -A .
git commit -am "feat: Initial commit"
git tag v0.1.0
Expand Down

0 comments on commit 02112bf

Please sign in to comment.