File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 66
77ACTIONS_WORKFLOW=pages-deploy.yml
88
9+ TEMP_SUFFIX=" to-delete" # temporary file suffixes that make `sed -i` compatible with BSD and Linux
10+
911help () {
1012 echo " Usage:"
1113 echo
@@ -61,12 +63,15 @@ init_files() {
6163 _workflow=" .github/workflows/${ACTIONS_WORKFLOW} "
6264 _default_branch=" $( git symbolic-ref refs/remotes/origin/HEAD | sed ' s@^refs/remotes/origin/@@' ) "
6365 _lineno=" $( sed -n " /branches:/=" " $_workflow " ) "
64- sed -i " $(( _lineno + 1 )) s/- .*/- ${_default_branch} /" " $_workflow "
66+
67+ sed -i.$TEMP_SUFFIX " $(( _lineno + 1 )) s/- .*/- ${_default_branch} /" " $_workflow "
68+ rm -f " $_workflow .$TEMP_SUFFIX "
6569
6670 fi
6771
6872 # trace the gem lockfile on user-end
69- sed -i " /Gemfile.lock/d" .gitignore
73+ sed -i.$TEMP_SUFFIX " /Gemfile.lock/d" .gitignore
74+ rm -f " .gitignore.$TEMP_SUFFIX "
7075
7176 # remove the other fies
7277 rm -f .travis.yml
You can’t perform that action at this time.
0 commit comments