File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424 git config --global user.name "GitHub Action"
2525 git config --global user.email "action@github.com"
2626 git config --global init.defaultBranch rendered
27- git init build/
2827 copier -f -d docker=True -d docs=True . build/ && cd build/
2928 poetry run task lint
3029 - name : Push rendered project
Original file line number Diff line number Diff line change @@ -50,10 +50,4 @@ _envops:
5050 variable_start_string : " {{"
5151 variable_end_string : " }}"
5252_tasks :
53- # Initialize poetry and git
54- - git log 2>&1 > /dev/null || poetry lock -q
55- - git log 2>&1 > /dev/null || poetry show --tree | grep '^\w' | awk '{ print $1 }' | sed 's/$/@latest/' | xargs poetry add -Dq
56- - git log 2>&1 > /dev/null || git init
57- - git log 2>&1 > /dev/null || git add --all
58- - git log 2>&1 > /dev/null || git commit -qm 'initial commit'
59- - printf "To create your repo:\n\tgh repo create -y {{repo_username}}/{{repo_name}} {% if private %}--private{% else %}--public{% endif %}"
53+ - bash postgenerate.sh
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -euo pipefail
4+ [ -n " ${DEBUG:- } " ] && set -x
5+
6+ GREEN=" $( tput setaf 2 2> /dev/null || printf ' ' ) "
7+ RESET=" $( tput sgr0 2> /dev/null || printf ' ' ) "
8+
9+ # If already initialized, abort
10+ if [ -d .git ] || [ -n " ${COPIER_SKIP_TASKS:- } " ]; then
11+ exit 0
12+ fi
13+
14+ # Delete this script
15+ rm -- " $0 "
16+
17+ echo -n " Resolving deps..."
18+ poetry lock -q
19+ poetry show --tree | grep ' ^\w' | awk ' { print $1 }' | sed ' s/$/@latest/' | xargs poetry add -q -D --lock > /dev/null
20+ echo -e " ${GREEN} ✔${RESET} "
21+
22+ echo -n " Installing deps..."
23+ poetry install > /dev/null
24+ echo -e " ${GREEN} ✔${RESET} "
25+
26+ echo -n " Initializing git..."
27+ git init -q
28+ git add --all
29+ git commit -qm ' initial commit'
30+ echo -e " ${GREEN} ✔${RESET} "
31+
32+ cat << EOF
33+ Done!
34+
35+ To create your repo:
36+ $ gh repo create -y {{repo_username}}/{{repo_name}} {% if private %}--private{% else %}--public{% endif %}
37+
38+ To create your PAT:
39+ $ gh secret set GITHUB_PAT -b \$ GITHUB_TOKEN
40+ EOF
You can’t perform that action at this time.
0 commit comments