Skip to content

Commit

Permalink
Add version
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Noah committed Jan 22, 2021
1 parent 9c726c3 commit 00316a7
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
deno-version: v1.x

- name: Build 🧱
run: deno run --unstable --allow-read --allow-write build.ts
run: deno run --unstable --allow-read --allow-write --allow-run build.ts

- uses: actions/upload-artifact@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ The list of supported map features can be found in issue [#2](https://github.com

> [Deno](https://deno.land/) v1.7.0+ is required to build the application.
`deno run --unstable --allow-read --allow-write build.ts`
`deno run --unstable --allow-read --allow-write --allow-run build.ts`

Or to run the live server with hot reloading: `deno run --unstable --allow-read --allow-write --allow-net build.ts serve`
Or to run the live server with hot reloading: `deno run --unstable --allow-read --allow-write --allow-net --allow-run build.ts serve`

## Contributing

Expand Down
5 changes: 5 additions & 0 deletions build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ async function build(): Promise<string>{
await loadJS();
}

const versionProcess = Deno.run({cmd: ["git", "describe", "--tags"], stdout: "piped", stderr: "piped"});
const version = new TextDecoder().decode(await versionProcess.output());
versionProcess.close();

return await renderToString(template, {
version,
css,
js
});
Expand Down
10 changes: 8 additions & 2 deletions src/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@
</span>
</div>
</div>
<div class="parent">
<span>Help</span>
<div class="menu">
<span><a href="https://github.com/BZFlagCommunity/webbzw/issues/new?labels=bug" target="_blank" rel="noopener noreferrer">Report a Bug</a></span>
<span><a href="https://github.com/BZFlagCommunity/webbzw/commits" target="_blank" rel="noopener noreferrer"><%= version %></a></span>
</div>
</div>
</nav>
<input type="file" id="bzw-file" accept=".bzw">
</header>
Expand All @@ -80,9 +87,8 @@
<span id="objects"></span>
<span id="vertices"></span>
<span style="flex:1"></span>
<span><a href="https://github.com/BZFlagCommunity/webbzw/issues/new?labels=bug" target="_blank" rel="noopener noreferrer">Report a Bug</a></span>
<span><a href="https://github.com/BZFlagCommunity/webbzw" target="_blank" rel="noopener noreferrer">GitHub</a></span>
<span>Copyright &copy; 2020-2021 The Noah</span>
<span>Copyright &copy; 2021 <a href="https://thenoah.dev" target="_blank" rel="noopener noreferrer">The Noah</a></span>
</footer>
<script><%- js %></script>
</body>
Expand Down
4 changes: 4 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ nav input[type=checkbox]{
margin-right: .5rem;
}

nav a{
text-decoration: none;
}

nav > div{
font-size: .9rem;
user-select: none;
Expand Down

0 comments on commit 00316a7

Please sign in to comment.