Skip to content

Commit

Permalink
not interested in the news, cheers
Browse files Browse the repository at this point in the history
  • Loading branch information
Rezzo64 committed Nov 23, 2023
1 parent 1b4801b commit 101f35b
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions build-tools/update
Original file line number Diff line number Diff line change
Expand Up @@ -179,28 +179,7 @@ crossprotocolContents = crossprotocolContents.replace(URL_REGEX, addCachebuster)
let replayEmbedContents = fs.readFileSync('play.pokemonshowdown.com/js/replay-embed.template.js', {encoding: 'utf8'});
replayEmbedContents = replayEmbedContents.replace(/play\.pokemonshowdown\.com/g, routes.client);

// add news, only if it's actually likely to exist
process.stdout.write("and news... ");
let stdout = '';
let newsid = 0;
let news = '[failed to retrieve news]';
try {
stdout = child_process.execSync('php ' + path.resolve(thisDir, 'news-embed.php'));
} catch (e) {
console.log("git hook failed to retrieve news (exec command failed):\n" + (e.error + e.stderr + e.stdout));
}
try {
if (stdout) [newsid, news] = JSON.parse(stdout);
} catch (e) {
console.log("git hook failed to retrieve news (parsing JSON failed):\n" + e.stack);
}

indexContents = indexContents.replace(/<!-- newsid -->/g, newsid);
indexContents = indexContents.replace(/<!-- news -->/g, news);

try {
indexContents = indexContents.replace(/<!-- head custom -->/g, '' + fs.readFileSync('config/head-custom.html'));
} catch (e) {}
// Nobody cares about the news. Cheers.

fs.writeFileSync('play.pokemonshowdown.com/index.html', indexContents);
fs.writeFileSync('play.pokemonshowdown.com/preactalpha.html', preactIndexContents);
Expand Down

0 comments on commit 101f35b

Please sign in to comment.