1
0
Fork 1
mirror of https://example.com synced 2024-11-22 20:56:40 +09:00

dev: add a delimiter in the version number

This commit is contained in:
naskya 2023-11-15 13:50:54 +09:00
parent ec76d58474
commit 27aaab3d34
Signed by: naskya
GPG key ID: 164DFF24E2D40139
2 changed files with 3 additions and 3 deletions

View file

@ -24,8 +24,8 @@ fi
# write version info
say "Writing version info to package.json..."
running "sed -e \"s/\\\"version\\\": \\\"\\([^+][^+]*\\).*\\\",$/\\\"version\\\": \\\"\\\\1+neko:$(version)\\\",/\" package.json > package.json.new && mv -- package.json.new package.json"
sed -e "s/\"version\": \"\([^+][^+]*\).*\",$/\"version\": \"\\1+neko:$(version)\",/" package.json > package.json.new && mv -- package.json.new package.json
running "sed \"s/\\\"version\\\": \\\"\\([^+][^+]*\\).*\\\",$/\\\"version\\\": \\\"\\\\1+neko:$(version)\\\",/\" package.json > package.json.new && mv -- package.json.new package.json"
sed "s/\"version\": \"\([^+][^+]*\).*\",$/\"version\": \"\\1+neko:$(version)\",/" package.json > package.json.new && mv -- package.json.new package.json
say "Done!"
br

View file

@ -23,5 +23,5 @@ br() {
version() {
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)
printf "%s%s" "${COMMIT_DATE}" "${COMMIT_HASH_INITIAL}"
printf "%s.%s" "${COMMIT_DATE}" "${COMMIT_HASH_INITIAL}"
}