Skip to content

Commit ad455e8

Browse files
committed
fix
1 parent 62f76f9 commit ad455e8

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

.github/workflows/test.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,17 @@ jobs:
2020
uses: actions/checkout@v4
2121
- name: Run Template Setup
2222
run: |
23-
git config user.name "Foo Bearer"
23+
24+
git config --global user.email "[email protected]"
25+
git config --global user.name "Your Name"
26+
2427
./setup.bash \
25-
"foo" \
26-
"Zenobius" \
27-
"Zenobius" \
28+
"@foo/bar_tool" \
29+
"bar_tool" \
30+
"username" \
31+
"author name" \
32+
"username/bar_tool" \
33+
"master" \
2834
"Apache-2.0" \
2935
"yes"
3036
@@ -35,6 +41,7 @@ jobs:
3541
exit 1
3642
}
3743
44+
3845
set -xe
3946
4047
ls -la .

justfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ test:
2323
act \
2424
-P ubuntu-latest=nektos/act-environments-ubuntu:18.04 \
2525
--secret-file .secrets \
26-
--env-file .env
26+
--env-file .env \
27+
-W .github/workflows/test.yml
2728

2829
@echo ""
2930
@echo "👍 Done"

setup.bash

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,18 @@ set_placeholder() {
100100
value="$2"
101101
out="$3"
102102

103+
# loop through file contents and replace placeholders
103104
git grep -P -l -F --untracked "$name" -- "$out" |
104105
while IFS=$'\n' read -r file; do
105106
tmpfile="$file.sed"
106107
sed "s#$name#$value#g" "$file" >"$tmpfile" && mv "$tmpfile" "$file"
108+
109+
# if filename contains placeholder, rename it
110+
if echo "$file" | grep -q "$name"; then
111+
mv "$file" "${file/$name/$value}"
112+
fi
107113
done
114+
108115
}
109116

110117
setup() {
@@ -214,6 +221,6 @@ case "${1:-}" in
214221
./template/tools.sh
215222
;;
216223
*)
217-
setup_github "$@"
224+
setup "$@"
218225
;;
219226
esac

0 commit comments

Comments
 (0)