<commit_before>import * as config from 'config';
import * as Runner from './runner';
import * as util from './util';
import * as data from './data';

export interface IPatchOptions
{
	authToken?: string;
	runLater?: boolean;
}

export abstract class Patcher
{
	static readonly PLATFORM_URL = config.get( 'domain' ) + '/x/updater/check_for_updates';

	static async patch( localPackage: GameJolt.IGamePackage, options?: IPatchOptions )
	{
		options = options || {};
		const dir = localPackage.install_dir;
		const port = await util.findFreePort();
		console.log( 'port: ' + port );
		const gameUid = localPackage.id + '-' + localPackage.build.id;
		const args: string[] = [
			'--port', port.toString(),
			'--dir', dir,
			'--game', gameUid,
			'--platform-url', this.PLATFORM_URL,
			'--paused',
			'--no-loader' ];
		if ( options.authToken ) {
			args.push( '--auth-token', options.authToken );
		}
		if ( options.runLater ) {<commit_msg>Hack a fix for config<commit_after>// import * as config from 'config';
import * as Runner from './runner';
import * as util from './util';
import * as data from './data';

export interface IPatchOptions
{
	authToken?: string;
	runLater?: boolean;
}

export abstract class Patcher
{
	static readonly PLATFORM_URL = 'https://gamejolt.com/x/updater/check-for-updates';

	static async patch( localPackage: GameJolt.IGamePackage, options?: IPatchOptions )
	{
		options = options || {};
		const dir = localPackage.install_dir;
		const port = await util.findFreePort();
		console.log( 'port: ' + port );
		const gameUid = localPackage.id + '-' + localPackage.build.id;
		const args: string[] = [
			'--port', port.toString(),
			'--dir', dir,
			'--game', gameUid,
			'--platform-url', this.PLATFORM_URL,
			'--paused',
			'--no-loader',
		];
		if ( options.authToken ) {
			args.push( '--auth-token', options.authToken );
		}
		if ( options.runLater ) {
{'fraction_non_alphanumeric': 0.16375198728139906, 'fraction_numerical': 0.0, 'mean_word_length': 3.5603864734299515, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5473145', 'n_tokens_mistral': 687, 'n_tokens_neox': 631, 'n_words': 163}