chore: improve init-tool
- cleanup unused code of init-tool - use conventional commits
This commit is contained in:
parent
7fd15a285f
commit
fa9879b5f1
1 changed files with 1 additions and 12 deletions
|
@ -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!"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue