From fa9879b5f14d0e9e4dd60d3c4394513963ca4b3f Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Mon, 5 Dec 2022 00:28:04 +0800 Subject: [PATCH] chore: improve init-tool - cleanup unused code of init-tool - use conventional commits --- tools/init.sh | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/tools/init.sh b/tools/init.sh index 7cc6e20..c6742f1 100755 --- a/tools/init.sh +++ b/tools/init.sh @@ -51,25 +51,14 @@ init_files() { rm -rf .github else ## Change the files of `.github` - mv .github/workflows/$ACTIONS_WORKFLOW.hook . rm -rf .github mkdir -p .github/workflows mv ./${ACTIONS_WORKFLOW}.hook .github/workflows/${ACTIONS_WORKFLOW} - ## Ensure the gh-actions trigger branch - - _workflow=".github/workflows/${ACTIONS_WORKFLOW}" - _default_branch="$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')" - _lineno="$(sed -n "/branches:/=" "$_workflow")" - - sed -i.$TEMP_SUFFIX "$((_lineno + 1))s/- .*/- ${_default_branch}/" "$_workflow" - rm -f "$_workflow.$TEMP_SUFFIX" - ## Cleanup image settings in site config sed -i.$TEMP_SUFFIX "s/^img_cdn:.*/img_cdn:/;s/^avatar:.*/avatar:/" _config.yml rm -f _config.yml.$TEMP_SUFFIX - fi # trace the gem lockfile on user-end @@ -82,7 +71,7 @@ init_files() { # save changes git add -A - git commit -m "[Automation] Initialize the environment." -q + git commit -m "chore: initialize the environment" -q echo "[INFO] Initialization successful!" }