Skip to content

Commit

Permalink
Displaying game version
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeychernyshev committed Aug 26, 2024
1 parent c01892b commit d765e66
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gitterra",
"version": "1.2.4",
"version": "1.2.6",
"description": "A git-based game running in CI/CD and played by coding",
"main": "src/generateMap.js",
"scripts": {
Expand Down
11 changes: 11 additions & 0 deletions src/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import {
languageStringToHexColor,
} from "./languages.js";

const version = fs.existsSync("../package.json")
? JSON.parse(fs.readFileSync("../package.json")).version
: null;

/**
* This function defines the algorythm for plotting city blocks maintaining the diamond shape.
* The input is a sequential number of the block and the output are
Expand Down Expand Up @@ -517,6 +521,12 @@ export const generateMapHTML = function (gameConfig, history) {
width: 15em;
}
#version {
display: block;
margin-top: -1.3em;
font-size: small;
}
</style>
</head>
Expand All @@ -530,6 +540,7 @@ export const generateMapHTML = function (gameConfig, history) {
src="https://gitterra.com/images/background_and_menus/logobanner.svg"
/>
</a>
<span id="version">v${version}</span>
</h1>
<div id="feedback">
<a href="https://gitlab.com/gitterra/GitTerra/-/issues/new" target="_blank">
Expand Down

0 comments on commit d765e66

Please sign in to comment.