|
2 | 2 |
|
3 | 3 | set -e |
4 | 4 |
|
5 | | -rm -f .github/workflows/check_version.yml |
6 | | -rm -f .github/workflows/ci.yml |
7 | | -rm -f .github/workflows/gh_releases.yml |
8 | | -rm -f .github/workflows/issue_opened.yml |
9 | | -rm -f .github/workflows/pr_opened.yml |
10 | | -rm -f .github/workflows/pr_updated.yml |
11 | | -rm -f .github/workflows/project_card_moved.yml |
12 | | -#rm -f .github/workflows/release.yml |
13 | | -rm -f .github/workflows/sync-workflows.yml |
14 | | -rm -f .github/workflows/toc.yml |
15 | | -rm -f .github/workflows/update-dependencies.yml |
16 | | - |
17 | | -rm -f .github/card-labeler.yml |
18 | | -rm -f .github/config.yml |
19 | | -rm -f .github/labeler.yml |
20 | | -rm -f .github/no-response.yml |
21 | | -rm -f .github/pr-labeler.yml |
22 | | -rm -f .github/release-drafter.yml |
23 | | -rm -f .github/stale.yml |
24 | | - |
25 | | -rm -rdf .github/ISSUE_TEMPLATE |
26 | | - |
27 | | -rm -f .github/CODE_OF_CONDUCT.md |
28 | | -rm -f .github/CODEOWNERS |
29 | | -rm -f .github/CONTRIBUTING.md |
30 | | -rm -f .github/FUNDING.yml |
31 | | -rm -f .github/pull_request_template.md |
32 | | - |
33 | | -rm -f _config.yml |
34 | | -rm -f README.md |
35 | | -touch README.md |
| 5 | +echo "Owner: [= technote-space]" |
| 6 | +read -r OWNER |
| 7 | +if [[ -z "${OWNER}" ]]; then |
| 8 | + OWNER=technote-space |
| 9 | +fi |
| 10 | + |
| 11 | +echo "Repo: " |
| 12 | +read -r REPO |
| 13 | +if [[ -z "${REPO}" ]]; then |
| 14 | + exit |
| 15 | +fi |
| 16 | + |
| 17 | +echo "Repository: ${OWNER}/${REPO}" |
| 18 | +# shellcheck disable=SC2162 |
| 19 | +read -n1 -p "ok? (y/N): " yn |
| 20 | +if [[ $yn != [yY] ]]; then |
| 21 | + exit |
| 22 | +fi |
| 23 | + |
| 24 | +sed -i "s/technote-space/${OWNER}/g" .github/CODEOWNERS |
| 25 | +sed -i "s/technote-space/${OWNER}/g" README.md |
| 26 | +sed -i "s/gh-actions-template/${REPO}/g" README.md |
| 27 | +sed -i "s/technote-space\/gh-actions-template/${OWNER}\/${REPO}/g" package.json |
| 28 | + |
| 29 | +if [[ "${OWNER}" != 'technote-space' ]]; then |
| 30 | + rm -f .github/FUNDING.yml |
| 31 | + rm -f _config.yml |
| 32 | + sed -i '25,100d' README.md |
| 33 | +fi |
36 | 34 |
|
37 | 35 | sed -i '/setup.sh/d' package.json |
| 36 | +touch __DELETE__ |
38 | 37 |
|
39 | 38 | cat << EOS |
40 | 39 | Please edit package.json |
41 | | - - name |
42 | 40 | - version |
43 | 41 | - description |
44 | 42 | - authoer |
45 | 43 | - license |
46 | 44 | - keywords |
47 | 45 | - homepage |
48 | | - - repository |
49 | | - - bugs |
50 | 46 | EOS |
0 commit comments