From 471e8c40188fcbf54fe86061a11d53834f1aa8e4 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Sat, 18 Mar 2023 00:49:26 +0800 Subject: [PATCH] chore(tools): resume git checkout in initialization --- tools/init | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/init b/tools/init index e5178db..af3ce76 100755 --- a/tools/init +++ b/tools/init @@ -77,6 +77,11 @@ check_env() { _check_init } +checkout_latest_tag() { + tag=$(git describe --tags "$(git rev-list --tags --max-count=1)") + git reset --hard "$tag" +} + init_files() { if $_no_gh; then rm -rf .github @@ -109,6 +114,7 @@ commit() { main() { check_env + checkout_latest_tag init_files commit }