]> git.sesse.net Git - remoteglot/commitdiff
Make the JSON output filename configurable.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 13 Nov 2014 21:56:06 +0000 (22:56 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 13 Nov 2014 21:56:06 +0000 (22:56 +0100)
config.pm
remoteglot.pl

index b9422e6e202e71abc805cada3d6ea9f6e9b2252d..2c3bedfb754aaa1566f06daee1d25b4bba99c78a 100644 (file)
--- a/config.pm
+++ b/config.pm
@@ -7,6 +7,7 @@ package remoteglotconf;
 our $server = "freechess.org";
 our $nick = "SesseBOT";
 our $target = "GMCarlsen";
+our $json_output = "/srv/analysis.sesse.net/www/analysis.json";
 
 our $engine_cmdline = "./stockfish";
 our %engine_config = (
index dd913f6a6855b45263c043691a380da6514a2920..10dead9315e21da0d4879bc384084f35cbf5f426 100755 (executable)
@@ -588,11 +588,11 @@ sub output_json {
        }
        $json->{'refutation_lines'} = \%refutation_lines;
 
-       open my $fh, ">/srv/analysis.sesse.net/www/analysis.json.tmp"
+       open my $fh, ">", $remoteglotconf::json_output . ".tmp"
                or return;
        print $fh JSON::XS::encode_json($json);
        close $fh;
-       rename("/srv/analysis.sesse.net/www/analysis.json.tmp", "/srv/analysis.sesse.net/www/analysis.json");
+       rename($remoteglotconf::json_output . ".tmp", $remoteglotconf::json_output);
 }
 
 sub uciprint {