From 6aaee16be03c92da1c97e552b07ebc7615e54c95 Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Sat, 13 Jun 2020 14:41:33 -0700 Subject: [PATCH] Build formats.js PS officially doesn't use this, but some bots used to read this directly from GitHub, and building it is nontrivial, so this lets bots read it from our webserver instead. It's available at: https://play.pokemonshowdown.com/data/formats.js (And as usual, feel free to use HTTP if your language's HTTPS implementation is hard to use.) --- build-tools/build-indexes | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build-tools/build-indexes b/build-tools/build-indexes index 006ad6d76..a533e0d39 100755 --- a/build-tools/build-indexes +++ b/build-tools/build-indexes @@ -1028,6 +1028,16 @@ process.stdout.write("Building `data/moves,items,abilities,typechart,learnsets.j fs.writeFileSync('data/formats-data.js', buf); } +/********************************************************* + * Build formats.js + *********************************************************/ + +{ + const Formats = requireNoCache('../data/Pokemon-Showdown/.config-dist/formats.js').Formats; + const buf = 'exports.Formats = ' + es3stringify(Formats) + ';'; + fs.writeFileSync('data/formats.js', buf); +} + /********************************************************* * Build learnsets.js *********************************************************/