diff --git a/.gitignore b/.gitignore index b2583b0f1..6f79a4598 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ npm-debug.log /play.pokemonshowdown.com/audio/ /play.pokemonshowdown.com/index.php /play.pokemonshowdown.com/index.html +/play.pokemonshowdown.com/index-test.html /play.pokemonshowdown.com/preactalpha.html /play.pokemonshowdown.com/crossprotocol.html /play.pokemonshowdown.com/data/ diff --git a/build-tools/swap-configs b/build-tools/swap-configs new file mode 100755 index 000000000..51eb34579 --- /dev/null +++ b/build-tools/swap-configs @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +cd "$(dirname "$0")" +cd .. +cp config/config.js config/config.js.old +cp config/head-custom.html config/head-custom.html.old +mv -f config/config-test.js config/config.js +mv -f config/head-custom-test.html config/head-custom.html +mv -i config/config.js.old config/config-test.js +mv -i config/head-custom.html.old config/head-custom-test.html diff --git a/build-tools/update b/build-tools/update index 7d19fa6ef..4d99acd89 100755 --- a/build-tools/update +++ b/build-tools/update @@ -197,11 +197,18 @@ try { indexContents = indexContents.replace(//g, newsid); indexContents = indexContents.replace(//g, news); +let indexContents2 = ''; try { + let indexContentsOld = indexContents; indexContents = indexContents.replace(//g, '' + fs.readFileSync('config/head-custom.html')); + indexContents2 = indexContentsOld.replace(//g, '' + fs.readFileSync('config/head-custom-test.html')); + indexContents2 = indexContents2.replace(/src="\/\/play.pokemonshowdown.com\/config\/config.js\?[a-z0-9]*"/, 'src="//play.pokemonshowdown.com/config/config-test.js?3"'); } catch (e) {} fs.writeFileSync('play.pokemonshowdown.com/index.html', indexContents); +if (indexContents2) { + fs.writeFileSync('play.pokemonshowdown.com/index-test.html', indexContents2); +} fs.writeFileSync('play.pokemonshowdown.com/preactalpha.html', preactIndexContents); fs.writeFileSync('play.pokemonshowdown.com/crossprotocol.html', crossprotocolContents); fs.writeFileSync('play.pokemonshowdown.com/js/replay-embed.js', replayEmbedContents); diff --git a/play.pokemonshowdown.com/config/config-test.js b/play.pokemonshowdown.com/config/config-test.js new file mode 120000 index 000000000..fbd23bfd4 --- /dev/null +++ b/play.pokemonshowdown.com/config/config-test.js @@ -0,0 +1 @@ +../../config/config-test.js \ No newline at end of file