Skip to content

Commit

Permalink
add version info to injector html
Browse files Browse the repository at this point in the history
  • Loading branch information
ayunami2000 committed Dec 27, 2024
1 parent d9c5e38 commit 2b6e9f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion build_injector.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/sh

BASE64BUNDLE="return '$(base64 dist/index.js)'"
VERSION="$(grep version package.json | sed -e 's/..version....//g' -e 's/...$//g')"
COMMITHASH="$(git rev-parse --short HEAD)"
echo -n $BASE64BUNDLE > bundle.b64
sed -e "/WISPCRAFTSRCBUNDLE/r bundle.b64" -e "/WISPCRAFTSRCBUNDLE/d" "index.html" > dist/injector.html
sed -e "s/WISPCRAFTVERSION/$VERSION/g" -e "s/WISPCRAFTCOMMITHASH/$COMMITHASH/g" -e "/WISPCRAFTSRCBUNDLE/r bundle.b64" -e "/WISPCRAFTSRCBUNDLE/d" "index.html" > dist/injector.html
rm bundle.b64
echo "Injector Build Complete!"
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ <h1>Wispcraft Injector</h1>
>A project by
<a href="https://mercurywork.shop">Mercury Workshop</a></span
>
<sup>Wispcraft WISPCRAFTVERSION (WISPCRAFTCOMMITHASH)</sup>
</div>
<script>
const downloadLink = document.querySelector("a[download]");
Expand Down

0 comments on commit 2b6e9f3

Please sign in to comment.