From 41b25228df01420e08364d2e43a9790e64485d08 Mon Sep 17 00:00:00 2001 From: naskya Date: Sun, 7 Jan 2024 16:50:21 +0900 Subject: [PATCH] dev: append first 2 digits of commit hash to version --- neko/update/utils | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neko/update/utils b/neko/update/utils index 230e51537..97fa784fa 100644 --- a/neko/update/utils +++ b/neko/update/utils @@ -30,13 +30,13 @@ br() { version() { UPSTREAM_VERSION=$(pnpm pkg get version | sed -e 's/"//g') COMMIT_DATE=$(git show --no-patch --pretty='%cs' FETCH_HEAD | sed -e 's/-//g' | cut -c 3-) - COMMIT_HASH_INITIAL=$(printf '%s' "$(git rev-parse FETCH_HEAD)" | cut -c 1) + COMMIT_HASH_INITIAL=$(printf '%s' "$(git rev-parse FETCH_HEAD)" | cut -c 1-2) printf '%s+neko:%s.%s' "${UPSTREAM_VERSION}" "${COMMIT_DATE}" "${COMMIT_HASH_INITIAL}" } version_ci() { UPSTREAM_VERSION=$(grep '"version":' package.json | cut -d '"' -f 4) COMMIT_DATE=$(git show --no-patch --pretty='%cs' HEAD | sed -e 's/-//g' | cut -c 3-) - COMMIT_HASH_INITIAL=$(printf '%s' "$(git rev-parse HEAD)" | cut -c 1) + COMMIT_HASH_INITIAL=$(printf '%s' "$(git rev-parse HEAD)" | cut -c 1-2) printf '%s+neko:%s.%s' "${UPSTREAM_VERSION}" "${COMMIT_DATE}" "${COMMIT_HASH_INITIAL}" }