Last active
May 15, 2023 08:29
-
-
Save loopmode/21ab0b42df200a614fa22304b500e064 to your computer and use it in GitHub Desktop.
prepends a comment with version info, timestamp and git commit hash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# prepends a comment with version info, timestamp and git commit hash | |
file="./build/embed.js" | |
timestamp=$(date '+%Y-%m-%d %H:%m:%S') | |
commithash=$(git rev-parse --short HEAD) | |
version=$(cat ./package.json | grep version -m 1 | sed 's/"version": "//' | sed 's/",//' | xargs) | |
buildinfo="$version $timestamp $commithash" | |
echo "/* $buildinfo */\n$(cat $file)" > $file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment