File tree Expand file tree Collapse file tree 3 files changed +21
-6
lines changed Expand file tree Collapse file tree 3 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -20,11 +20,17 @@ jobs:
20
20
uses : actions/checkout@v4
21
21
- name : Run Template Setup
22
22
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
+
24
27
./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" \
28
34
"Apache-2.0" \
29
35
"yes"
30
36
35
41
exit 1
36
42
}
37
43
44
+
38
45
set -xe
39
46
40
47
ls -la .
Original file line number Diff line number Diff line change 23
23
act \
24
24
- P ubuntu-latest=nektos/ act-environments-ubuntu:18.04 \
25
25
- -secret-file .secrets \
26
- - -env -file .env
26
+ - -env -file .env \
27
+ - W .github/ workflows/ test.yml
27
28
28
29
@ echo " "
29
30
@ echo " 👍 Done"
Original file line number Diff line number Diff line change @@ -100,11 +100,18 @@ set_placeholder() {
100
100
value=" $2 "
101
101
out=" $3 "
102
102
103
+ # loop through file contents and replace placeholders
103
104
git grep -P -l -F --untracked " $name " -- " $out " |
104
105
while IFS=$' \n ' read -r file; do
105
106
tmpfile=" $file .sed"
106
107
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
107
113
done
114
+
108
115
}
109
116
110
117
setup () {
@@ -214,6 +221,6 @@ case "${1:-}" in
214
221
./template/tools.sh
215
222
;;
216
223
* )
217
- setup_github " $@ "
224
+ setup " $@ "
218
225
;;
219
226
esac
You can’t perform that action at this time.
0 commit comments