<commit_before>package create;

import haxe.Resource;
import create.section.Config.ConfigOptions;
import create.ides.VSCode;
import create.ides.HaxeDevelop;
import sys.FileSystem;
import sys.io.File;
import types.ProjectType;

/**
 * Create
 * @author AxGord <<EMAIL>>
 */
class Create {

	private static var outputFile: String = 'app';

	public static function run(sType: String, name: String): Void {
		// todo: create remote key@host:port
		var type: ProjectType = null;
		if (sType != null) for (t in ProjectType.createAll()) {
			if (t.getName().toLowerCase() == sType.toLowerCase()) {
				type = t;
				break;
			}
		}
		if (type == null) Utils.error('Wrong app type');
		if (FileSystem.exists(Utils.MAIN_FILE)) Utils.error(Utils.MAIN_FILE + ' exists');
		var project: Project = new Project(name);
		setProjectConfig(project, type);
		Utils.savePonyProject(project.result());
		createProjectData(project, type);
		Utils.command('pony', ['prepare']);
	}

	private static function setProjectConfig(project: Project, type: ProjectType): Void {
		switch type {
			case ProjectType.Server: create.targets.Server.set(project);
			case ProjectType.JS: create.targets.JS.set(project);
			case ProjectType.CC: create.targets.CC.set(project);
			case ProjectType.Pixi, ProjectType.Pixixml: create.targets.Pixi.set(project);
			case ProjectType.Heaps, ProjectType.Heapsxml: create.targets.Heaps.set(project);
			case ProjectType.Cordova: create.targets.Cordova.set(project);
			case ProjectType.Node: create.targets.Node.set(project);<commit_msg>Tools: copy hxformat to new projects<commit_after>package create;

import pony.Tools;
import haxe.Resource;
import create.section.Config.ConfigOptions;
import create.ides.VSCode;
import create.ides.HaxeDevelop;
import sys.FileSystem;
import sys.io.File;
import types.ProjectType;

/**
 * Create
 * @author AxGord <<EMAIL>>
 */
class Create {

	private static var outputFile: String = 'app';
	private static var formatFile: String = 'hxformat.json';

	public static function run(sType: String, name: String): Void {
		// todo: create remote key@host:port
		var type: ProjectType = null;
		if (sType != null) for (t in ProjectType.createAll()) {
			if (t.getName().toLowerCase() == sType.toLowerCase()) {
				type = t;
				break;
			}
		}
		if (type == null) Utils.error('Wrong app type');
		if (FileSystem.exists(Utils.MAIN_FILE)) Utils.error(Utils.MAIN_FILE + ' exists');
		var project: Project = new Project(name);
		setProjectConfig(project, type);
		Utils.savePonyProject(project.result());
		createProjectData(project, type);
		File.copy(Tools.ponyPath() + formatFile, Sys.getCwd() + formatFile);
		Utils.command('pony', ['prepare']);
	}

	private static function setProjectConfig(project: Project, type: ProjectType): Void {
		switch type {
			case ProjectType.Server: create.targets.Server.set(project);
			case ProjectType.JS: create.targets.JS.set(project);
			case ProjectType.CC: create.targets.CC.set(project);
			case ProjectType.Pixi, ProjectType.Pixixml: create.targets.Pixi.set(project);
			case ProjectType.Heaps, ProjectType.Heapsxml: create.targets.Heaps.set(project);
			case ProjectType.Cordova: create.targets.Cordova.set(project);
			case ProjectType.Node: create.targets.Node.set(project);
{'fraction_non_alphanumeric': 0.13525976022133415, 'fraction_numerical': 0.0, 'mean_word_length': 4.863063063063063, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5256582', 'n_tokens_mistral': 1130, 'n_tokens_neox': 1029, 'n_words': 240}