mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-03-21 17:50:29 -05:00
Support test configs
This adds support for test configs, to make it easier to test config changes without affecting the live service.
This commit is contained in:
parent
09c248382a
commit
c2ec42310c
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -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/
|
||||
|
|
|
|||
9
build-tools/swap-configs
Executable file
9
build-tools/swap-configs
Executable file
|
|
@ -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
|
||||
|
|
@ -197,11 +197,18 @@ try {
|
|||
indexContents = indexContents.replace(/<!-- newsid -->/g, newsid);
|
||||
indexContents = indexContents.replace(/<!-- news -->/g, news);
|
||||
|
||||
let indexContents2 = '';
|
||||
try {
|
||||
let indexContentsOld = indexContents;
|
||||
indexContents = indexContents.replace(/<!-- head custom -->/g, '' + fs.readFileSync('config/head-custom.html'));
|
||||
indexContents2 = indexContentsOld.replace(/<!-- head custom -->/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);
|
||||
|
|
|
|||
1
play.pokemonshowdown.com/config/config-test.js
Symbolic link
1
play.pokemonshowdown.com/config/config-test.js
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../config/config-test.js
|
||||
Loading…
Reference in New Issue
Block a user