Skip to content

Commit 274f1a3

Browse files
committed
refactor: 🔨 contributor script outputs text, output to file with justfile
1 parent 7536e89 commit 274f1a3

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ build-readme:
7070

7171
# Generate a Quarto include file with the contributors
7272
build-contributors:
73-
sh ./tools/get-contributors.sh seedcase-project/template-python-project
73+
sh ./tools/get-contributors.sh seedcase-project/template-python-project > docs/includes/_contributors.qmd

template/justfile.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ build-readme:
114114

115115
# Generate a Quarto include file with the contributors
116116
build-contributors:
117-
sh ./tools/get-contributors.sh {{ github_repo_spec }}
117+
sh ./tools/get-contributors.sh {{ github_repo_spec }} >> docs/includes/_contributors.qmd
118118

119119
# Check for and apply updates from the template
120120
update-from-template:

template/tools/get-contributors.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
# - Removes any usernames with the word "bot" in them.
88
# - Removes the trailing comma from the list.
99
repo_spec=${1}
10-
echo "These are the people who have contributed by submitting changes through pull requests :tada:\n\n" > _contributors.qmd
11-
gh api \
10+
contributors=$(gh api \
1211
-H "Accept: application/vnd.github+json" \
1312
-H "X-GitHub-Api-Version: 2022-11-28" \
1413
/repos/$repo_spec/contributors \
1514
--template '{{range .}} [\@{{.login}}]({{.html_url}}){{"\n"}}{{end}}' | \
1615
grep -v "\[bot\]" | \
1716
tr '\n' ', ' | \
18-
sed -e 's/,$//' >> _contributors.qmd
17+
sed -e 's/,$/\n/'
18+
)
19+
20+
echo "The following people have contributed to this project by submitting pull requests :tada:\n\n${contributors}"

tools/get-contributors.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
# - Removes any usernames with the word "bot" in them.
88
# - Removes the trailing comma from the list.
99
repo_spec=${1}
10-
echo "These are the people who have contributed by submitting changes through pull requests :tada:\n\n" > _contributors.qmd
11-
gh api \
10+
contributors=$(gh api \
1211
-H "Accept: application/vnd.github+json" \
1312
-H "X-GitHub-Api-Version: 2022-11-28" \
1413
/repos/$repo_spec/contributors \
1514
--template '{{range .}} [\@{{.login}}]({{.html_url}}){{"\n"}}{{end}}' | \
1615
grep -v "\[bot\]" | \
1716
tr '\n' ', ' | \
18-
sed -e 's/,$//' >> _contributors.qmd
17+
sed -e 's/,$/\n/'
18+
)
19+
20+
echo "The following people have contributed to this project by submitting pull requests :tada:\n\n${contributors}"

0 commit comments

Comments
 (0)