Skip to content

Commit

Permalink
refactor(octra): fix small issues
Browse files Browse the repository at this point in the history
  • Loading branch information
julianpoemp committed Jan 8, 2025
1 parent 5850cbc commit b0a0c5f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
10 changes: 5 additions & 5 deletions apps/octra/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@
}
</style>
<script type="application/javascript" id="build_meta">
var BUILD = {
version: '2.0.0',
hash: '1234-1234-1234-1234',
timestamp: '23.11.23 12:00',
};
/* var BUILD = {
"version": "2.0.0",
"hash": "1234-1234-1234-1234",
"timestamp": "23.11.23 12:00"
}; */
</script>
</head>
<body>
Expand Down
1 change: 1 addition & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"sharedGlobals": ["{workspaceRoot}/.github/workflows/ci.yml"]
},
"nxCloudId": "677cf0775ad9512e8f749d0a",
"neverConnectToCloud": true,
"targetDefaults": {
"@angular-devkit/build-angular:application": {
"cache": true,
Expand Down
6 changes: 3 additions & 3 deletions runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,13 @@ async function setBuildVariable() {

let hash = crypto.randomUUID();

content = content.replace(/(var BUILD =)([^;]*)(;)/gs, (g0, g1, g2, g3) => {
const build = JSON.parse(g2);
content = content.replace(/(\/\*)\s*(var BUILD =)([^;]*)(;)\s?(\*\/)\s*/gs, (g0, g1, g2, g3, g4) => {
const build = JSON.parse(g3);
build.version = pkg.version;
build.timestamp = new Date().toISOString();
build.hash = hash;

return `${g1} ${JSON.stringify(build)}${g3}`;
return `${g2} ${JSON.stringify(build)}${g4}`;
});

await fs.writeFile('./dist/apps/octra/index.html', content, {
Expand Down

0 comments on commit b0a0c5f

Please sign in to comment.