Skip to content

Commit

Permalink
fix: HASSU-1052 setting default version info regardless fs errors (#420)
Browse files Browse the repository at this point in the history
  • Loading branch information
kettunju committed Oct 3, 2022
1 parent 1e12bb9 commit c9b25dc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,12 @@ module.exports = (phase) => {
if (phase === PHASE_DEVELOPMENT_SERVER) {
config = setupLocalDevelopmentMode(config, env);
} else {
env.VERSION = process.env.CODEBUILD_SOURCE_VERSION; // default version info, overriden in test&prod by semantic version
try {
const fs = require("fs");
let buffer = fs.readFileSync(__dirname + "/.version");
if (buffer) {
env.VERSION = buffer.toString("UTF-8");
} else {
env.VERSION = process.env.CODEBUILD_SOURCE_VERSION;
}
} catch (e) {
// Ignore
Expand Down

0 comments on commit c9b25dc

Please sign in to comment.