a2s.su/update_commit.sh

13 lines
291 B
Bash
Raw Normal View History

2023-08-04 00:45:01 +03:00
#!/bin/sh
if [ -f "./public/index.html" ]; then
GIT_COMMIT_HASH=$(git rev-parse --short HEAD)
echo -n "Update git commit hash in 'index.html' "
sed -i -- "s/{GIT_COMMIT_HASH}/$GIT_COMMIT_HASH/g" ./public/index.html
echo " Complete!"
else
echo "Run 'npm run build'"
fi