diff --git a/.build/install.j2.sh b/.build/install.j2.sh index 09d4a74..7d67f5e 100755 --- a/.build/install.j2.sh +++ b/.build/install.j2.sh @@ -36,7 +36,8 @@ _add_hyakvnc_to_path() { _install_hyakvnc() { _HYAKVNC_DIR="${_HYAKVNC_DIR:-${HOME}/.hyakvnc}" # %% Local directory to store application data (default: `$HOME/.hyakvnc`) _HYAKVNC_REPO_DIR="${_HYAKVNC_REPO_DIR:-${_HYAKVNC_DIR}/hyakvnc}" # Local directory to store git repository (default: `$HYAKVNC_DIR/hyakvnc`) - _HYAKVNC_REPO_URL="${_HYAKVNC_REPO_URL:-"{{j2_hyakvnc_repo_url}}"}" + _HYAKVNC_REPO_URL="${_HYAKVNC_REPO_URL:-"{{ github_repository }}"}" + _HYAKVNC_REPO_BRANCH="${_HYAKVNC_REPO_BRANCH:-"{{ github_ref_name }}"}" # shellcheck disable=SC2016 _UNEXPANDED_BIN_INSTALL_DIR='${HOME}/.local/bin' # Local directory to store executable (default: `$HOME/.local/bin`) @@ -46,7 +47,7 @@ _install_hyakvnc() { mkdir -p "${_BIN_INSTALL_DIR}" && rm -rf "${_HYAKVNC_DIR}/hyakvnc-tmp" && echo "Fetching hyakvnc from ${_HYAKVNC_REPO_URL}" 2>&1 && - git clone --depth 1 --single-branch --quiet "${_HYAKVNC_REPO_URL}" ~/.hyakvnc/hyakvnc-tmp && + git clone --branch "${_HYAKVNC_REPO_BRANCH}" --depth 1 --single-branch --quiet "${_HYAKVNC_REPO_URL}" ~/.hyakvnc/hyakvnc-tmp && rm -rf "${_HYAKVNC_REPO_DIR}" && mv "${_HYAKVNC_DIR}/hyakvnc-tmp" "${_HYAKVNC_REPO_DIR}" && ln -sf "${_HYAKVNC_REPO_DIR}/hyakvnc" "${_BIN_INSTALL_DIR}/hyakvnc" && diff --git a/.github/workflows/build-documentation.yml b/.github/workflows/build-documentation.yml index 2ce17c1..9fa908f 100644 --- a/.github/workflows/build-documentation.yml +++ b/.github/workflows/build-documentation.yml @@ -24,7 +24,7 @@ jobs: sed -E '/^HYAKVNC_.*#\s*%%/!d; s/=.*(#\s*%%)/:/g; s/(^.)/- \1/g' ../hyakvnc > config.inc.md for x in create status show stop config update install; do ../hyakvnc help "$x" | sed -E '1 s/(.*)/\n### \1\n/; 2 s/^$/```text/' | pr -e4 -t && echo '```'; done > usage.inc.md jinja -D github_repository "${{ github.repository }}" -D github_ref_name "${{ github.ref_name }}" README.j2.md | sed 's/^.*.*$//g' > ../README.md - jinja -D j2_hyakvnc_repo_url 'https://github.com/${{ github.repository }}' install.j2.sh -o ../install.sh + jinja -D github_repository 'https://github.com/${{ github.repository }}' -D github_ref_name '${{ github.ref_name }}' install.j2.sh -o ../install.sh popd git config --local user.email "${{ github.event.sender.id }}+${{ github.event.sender.login }}@users.noreply.github.com"