Skip to content

Commit f4ebafc

Browse files
authored
🧼 [just] generate clean README (#5)
* 🧼 [just] generate clean readme * add just release * document new recipes * release anytime
1 parent f25ae21 commit f4ebafc

File tree

2 files changed

+53
-8
lines changed

2 files changed

+53
-8
lines changed

.github/CONTRIBUTING.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,21 @@ You should get a more colorful version of this:
5858
just --list
5959
Available recipes:
6060
[Compliance]
61-
compliance_check # our own compliance check
61+
compliance_check # our own compliance check
6262

6363
[Process]
64-
branch branchname # start a new branch
65-
merge # merge PR and return to starting point
66-
pr # PR create 3.0
67-
prweb # view PR in web browser
68-
sync # escape from branch, back to starting point
64+
branch branchname # start a new branch
65+
merge # merge PR and return to starting point
66+
pr # PR create 3.0
67+
prweb # view PR in web browser
68+
release rel_version # make a release
69+
sync # escape from branch, back to starting point
6970

7071
[Utility]
71-
utcdate # print UTC date in ISO format
72+
clean_readme # generate a clean README
73+
utcdate # print UTC date in ISO format
7274

7375
[example]
74-
list # list recipes (default works without naming it)
76+
list # list recipes (default works without naming it)
7577
Your justfile is waiting for more scripts and snippets
7678
```

justfile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,44 @@ _main_branch:
106106
@utcdate:
107107
TZ=UTC date +"%Y-%m-%d"
108108

109+
# generate a clean README
110+
[group('Utility')]
111+
[no-cd]
112+
clean_readme:
113+
#!/usr/bin/env bash
114+
set -euo pipefail # strict mode without tracing
115+
116+
GIT_ORIGIN=$(git config --get remote.origin.url | sed -e 's/^.*://' -e 's/[.]git$//')
117+
#echo "$GIT_ORIGIN"
118+
119+
GITHUB_ORG=$(echo "$GIT_ORIGIN" | sed -e 's/[/].*$//')
120+
echo "org={{BLUE}}$GITHUB_ORG{{NORMAL}}"
121+
122+
GITHUB_REPO=$(echo "$GIT_ORIGIN" | sed -e 's/^.*[/]//')
123+
echo "repo={{BLUE}}$GITHUB_REPO{{NORMAL}}"
124+
125+
cat > README.md << END_OF_HEREDOC
126+
# FINI template-repo
127+
128+
![GitHub Issues](https://img.shields.io/github/issues/${GITHUB_ORG}/${GITHUB_REPO})
129+
![GitHub Pull Requests](https://img.shields.io/github/issues-pr/${GITHUB_ORG}/${GITHUB_REPO})
130+
![GitHub License](https://img.shields.io/github/license/${GITHUB_ORG}/${GITHUB_REPO})
131+
![GitHub watchers](https://img.shields.io/github/watchers/${GITHUB_ORG}/${GITHUB_REPO})
132+
133+
A good starting place for new github repos.
134+
135+
## Contibuting
136+
137+
- [Code of Conduct](.github/CODE_OF_CONDUCT.md)
138+
- [Contributing Guide](.github/CONTRIBUTING.md) includes a step-by-step guide to our
139+
[development processs](.github/CONTRIBUTING.md#development-process).
140+
141+
## Support
142+
143+
- [Getting Support](.github/SUPPORT.md)
144+
- [Security](.github/SECURITY.md)
145+
END_OF_HEREDOC
146+
109147
# our own compliance check
110148
[group('Compliance')]
111149
compliance_check:
@@ -188,3 +226,8 @@ compliance_check:
188226
echo "{{RED}}You do NOT have a justfile. Feeling the FOMO yet?{{NORMAL}}"
189227
echo "{{RED}}And this should not be possible. Tell me how you got here.{{NORMAL}}"
190228
fi
229+
230+
# make a release
231+
[group('Process')]
232+
release rel_version:
233+
gh release create {{rel_version}} --generate-notes

0 commit comments

Comments
 (0)