From 4a084eb681654808af93f0864cff4bf46f5fdc9f Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Thu, 28 Jan 2021 04:57:11 +0800 Subject: [PATCH] Add new tool to build gem --- tools/bump.sh | 3 ++- tools/gem.sh | 22 ++++++++++++++++++++++ tools/pv.sh | 20 -------------------- 3 files changed, 24 insertions(+), 21 deletions(-) create mode 100755 tools/gem.sh delete mode 100755 tools/pv.sh diff --git a/tools/bump.sh b/tools/bump.sh index e9d1bc2..3c0390d 100755 --- a/tools/bump.sh +++ b/tools/bump.sh @@ -2,9 +2,10 @@ # # Bump latest version to # - _sass/jekyll-theme-chirpy.scss -# - assets/js/_commons/_copyright.js +# - assets/js/.copyright.js # - assets/js/dist/*.js # - jekyll-theme-chirpy.gemspec +# - package.json # # Required: gulp diff --git a/tools/gem.sh b/tools/gem.sh new file mode 100755 index 0000000..0ef0f38 --- /dev/null +++ b/tools/gem.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# +# Create a ruby-gem pakcage with doc +# +# Required: rubygem, yard + +set -eu + +GEM_CONFIG="./jekyll-theme-chirpy.gemspec" + +if [[ ! -f $GEM_CONFIG ]]; then + echo "Error: .gemspec file not found!" + exit -1 +fi + +if [[ -d doc ]]; then + rm -rf doc +fi + +yard doc + +gem build "$GEM_CONFIG" diff --git a/tools/pv.sh b/tools/pv.sh deleted file mode 100755 index c0064e1..0000000 --- a/tools/pv.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -# -# Fetch Google Analytics Pageviews reporting cache -# and save as 'assets/data/pagevies.json' -# -# Requirement: -# - jq -# - wget - -set -eu - -WORK_DIR="$(dirname "$(dirname "$(realpath "$0")")")" -URL_FILE="${WORK_DIR}/_config.yml" -PV_CACHE="${WORK_DIR}/assets/js/data/pageviews.json" - -PROXY_URL="$(grep "proxy_endpoint:" "$URL_FILE" | sed "s/.*: '//g;s/'.*//")" - -wget "$PROXY_URL" -O "$PV_CACHE" - -echo "ls $PV_CACHE"