From 6fa1777eb0fbed03532b76e4da1de73de3b07200 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Wed, 28 Dec 2022 01:11:27 +0800 Subject: [PATCH] chore(tools): checkout latest tag on initialization --- tools/init | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/init b/tools/init index 656a641..f4a1f30 100755 --- a/tools/init +++ b/tools/init @@ -46,6 +46,11 @@ check_init() { fi } +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 @@ -100,4 +105,6 @@ while (($#)); do esac done +checkout_latest_tag + init_files