Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/ghostfolio/src/commit/c4e8e378844fcf6a562c53f7d90623deb8bf4b5d/replace.build.js You should set ROOT_URL correctly, otherwise the web may not work correctly.
ghostfolio/replace.build.js

34 lines
830 B

const dotenv = require('dotenv');
const path = require('path');
const replace = require('replace-in-file');
dotenv.config({
path: path.resolve(__dirname, '.env')
});
const now = new Date();
const buildTimestamp = `${formatWithTwoDigits(
now.getDate()
)}.${formatWithTwoDigits(
now.getMonth() + 1
)}.${now.getFullYear()} ${formatWithTwoDigits(
now.getHours()
)}:${formatWithTwoDigits(now.getMinutes())}`;
try {
const changedFiles = replace.sync({
files: './dist/apps/client/main.*.js',
from: /{BUILD_TIMESTAMP}/g,
to: buildTimestamp,
allowEmptyPaths: false
});
console.log('Build version set: ' + buildTimestamp);
console.log(changedFiles);
} catch (error) {
console.error('Error occurred:', error);
}
function formatWithTwoDigits(aNumber) {
return aNumber < 10 ? '0' + aNumber : aNumber;
}