Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,28 @@ async function getStatusValues () {
console.log('ERROR in getGitValues node/npm: ', error);
}
try {
console.log('Working Directory: ', __dirname);
let hash = fs.readFileSync('./git_commit_hash', 'utf8');
console.log('Hash: ', hash);
hash = hash.trim();
const hashURL = `https://github.com/wevote/weconnect-server/commit/${hash}`;
const hashURL = `https://github.com/wevote/weconnect-client/commit/${hash}`;
console.log('hashURL: ', hashURL);
const response = await fetch(hashURL);
const text = await response.text();
console.log(`git_commit_hash: '${text}'`);
const pr = text.match(/"Merge pull request (.*?)wevote/);
stats.Pull_request = pr[1].slice(0, -2);
const dateStringResults = text.match(/"committedDate":"(.*?)"/);
console.log(dateStringResults[1]);
const date = new DateTime(dateStringResults[1]);
stats.Git_committed_date = date.toLocaleString(DateTime.DATETIME_MED_WITH_SECONDS);
stats.Git_commit_hash = `<a href="${hashURL}">${hash}</a>`;
if (text !== 'Not Found') {
const pr = text.match(/"Merge pull request (.*?)wevote/);
stats.Pull_request = pr[1].slice(0, -2);
const dateStringResults = text.match(/"committedDate":"(.*?)"/);
console.log(dateStringResults[1]);
const date = new DateTime(dateStringResults[1]);
stats.Git_committed_date = date.toLocaleString(DateTime.DATETIME_MED_WITH_SECONDS);
stats.Git_commit_hash = `<a href="${hashURL}">${hash}</a>`;
} else {
stats.Pull_request = 'none';
stats.Git_committed_date = 'none';
stats.Git_commit_hash = 'Not Found';
}
} catch (error) {
console.log('Error in getStatusValues git: ', error);
}
Expand Down Expand Up @@ -224,12 +233,7 @@ module.exports = async (env, argv) => {
} : {}),
client: {
overlay: {
runtimeErrors: (error) => {
if (error.message.includes('ResizeObserver loop')) {
return false;
}
return true;
},
runtimeErrors: (error) => !error.message.includes('ResizeObserver loop'),
},
},
},
Expand Down
Loading