From b27258899b10c69ef5e1ebc842c008f842cc9676 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Thu, 3 Feb 2022 23:58:52 +0800 Subject: [PATCH] Clear references to deleted folder `docs` --- .github/workflows/ci.yml | 1 - _config.yml | 1 - _posts/2019-08-09-getting-started.md | 1 - package.json | 7 ----- tools/init.sh | 46 +++++++++++++--------------- 5 files changed, 22 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f2222fc..1e134ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,6 @@ on: - '!.github/workflows/ci.yml' - '.travis.yml' - '.gitignore' - - 'docs/**' - 'README.md' - 'LICENSE' pull_request: diff --git a/_config.yml b/_config.yml index b5b89a3..36cf2f5 100644 --- a/_config.yml +++ b/_config.yml @@ -166,7 +166,6 @@ exclude: - '*.gem' - '*.gemspec' - tools - - docs - README.md - LICENSE - gulpfile.js diff --git a/_posts/2019-08-09-getting-started.md b/_posts/2019-08-09-getting-started.md index bbd09b4..d1527ed 100644 --- a/_posts/2019-08-09-getting-started.md +++ b/_posts/2019-08-09-getting-started.md @@ -44,7 +44,6 @@ The above command will: 1. Removes some files or directories from your repository: - `.travis.yml`{: .filepath} - files under `_posts`{: .filepath} - - folder `docs`{: .filepath} 2. If the option `--no-gh` is provided, the directory `.github`{: .filepath} will be deleted. Otherwise, set up the GitHub Action workflow by removing the extension `.hook`{: .filepath} of `.github/workflows/pages-deploy.yml.hook`{: .filepath}, and then remove the other files and directories in the folder `.github`{: .filepath}. diff --git a/package.json b/package.json index 0333b57..aca498d 100644 --- a/package.json +++ b/package.json @@ -2,13 +2,6 @@ "name": "jekyll-theme-chirpy", "version": "5.0.2", "description": "A minimal, sidebar, responsive web design Jekyll theme that focuses on text presentation.", - "main": "index.js", - "directories": { - "doc": "docs" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, "repository": { "type": "git", "url": "git+https://github.com/cotes2020/jekyll-theme-chirpy.git" diff --git a/tools/init.sh b/tools/init.sh index e8c7b18..33b5209 100755 --- a/tools/init.sh +++ b/tools/init.sh @@ -28,16 +28,14 @@ check_status() { check_init() { local _has_inited=false - if [[ ! -d docs ]]; then - if [[ ! -d .github ]]; then - _has_inited=true # --no-gh - else - if [[ -f .github/workflows/$ACTIONS_WORKFLOW ]]; then - # on BSD, the `wc` could contains blank - local _count="$(find .github/workflows/ -type f -name "*.yml" | wc -l)" - if [[ ${_count//[[:blank:]]/} == 1 ]]; then - _has_inited=true - fi + if [[ ! -d .github ]]; then # using option `--no-gh` + _has_inited=true + else + if [[ -f .github/workflows/$ACTIONS_WORKFLOW ]]; then + # on BSD, the `wc` could contains blank + local _count="$(find .github/workflows/ -type f -name "*.yml" | wc -l)" + if [[ ${_count//[[:blank:]]/} == 1 ]]; then + _has_inited=true fi fi fi @@ -80,7 +78,7 @@ init_files() { # remove the other fies rm -f .travis.yml - rm -rf _posts/* docs + rm -rf _posts/* # save changes git add -A @@ -98,19 +96,19 @@ _no_gh=false while (($#)); do opt="$1" case $opt in - --no-gh) - _no_gh=true - shift - ;; - -h | --help) - help - exit 0 - ;; - *) - # unknown option - help - exit 1 - ;; + --no-gh) + _no_gh=true + shift + ;; + -h | --help) + help + exit 0 + ;; + *) + # unknown option + help + exit 1 + ;; esac done