<commit_before><?php

namespace minion\Tasks;


use minion\Config\Environment;
use minion\Connections\ConnectionAbstract;

class Release extends TaskAbstract {

	public function run(Environment $environment, ConnectionAbstract $connection) {

		// Make sure releases directory exists
		$connection->execute("mkdir -p {$environment->remote->getReleases()}");

		// Create a new release
		$release = date('YmdHis');

		$environment->remote->setActiveRelease($release);

		if( ($branch = $this->input->getOption('branch')) === null ) {
			$branch = $environment->code->branch;
		}

		if( ($commit = $this->input->getOption('commit')) === null ) {
			$commit = null;
		}

		// What SCM command?
		switch( strtolower($environment->code->scm) ) {
			case 'git':
				if( $commit ) {
					$command = "git clone {$environment->code->repo} --branch={$branch} {$release}&&cd {$release}&&git checkout {$commit}";
				}
				else {
					$command = "git clone {$environment->code->repo} --depth=1 --branch={$branch} {$release}";
				}
                $connection->execute("cd {$environment->remote->getReleases()}&&{$command}");
                $environment->code->setActiveCommit($connection->execute("cd {$environment->remote->getReleases()}/{$release}&&git rev-parse HEAD"));
                $environment->code->setActiveCommitAuthor($connection->execute("cd {$environment->remote->getReleases()}/{$release}&&git log {$environment->code->getActiveCommit()}.. --format='%an'"));<commit_msg>Trimming up new lines causing issues<commit_after><?php

namespace minion\Tasks;


use minion\Config\Environment;
use minion\Connections\ConnectionAbstract;

class Release extends TaskAbstract {

	public function run(Environment $environment, ConnectionAbstract $connection) {

		// Make sure releases directory exists
		$connection->execute("mkdir -p {$environment->remote->getReleases()}");

		// Create a new release
		$release = date('YmdHis');

		$environment->remote->setActiveRelease($release);

		if( ($branch = $this->input->getOption('branch')) === null ) {
			$branch = $environment->code->branch;
		}

		if( ($commit = $this->input->getOption('commit')) === null ) {
			$commit = null;
		}

		// What SCM command?
		switch( strtolower($environment->code->scm) ) {
			case 'git':
				if( $commit ) {
					$command = "git clone {$environment->code->repo} --branch={$branch} {$release}&&cd {$release}&&git checkout {$commit}";
				}
				else {
					$command = "git clone {$environment->code->repo} --depth=1 --branch={$branch} {$release}";
				}
				$connection->execute("cd {$environment->remote->getReleases()}&&{$command}");
				$environment->code->setActiveCommit(trim($connection->execute("cd {$environment->remote->getReleases()}/{$release}&&git rev-parse HEAD")));
                $environment->code->setActiveCommitAuthor($connection->execute("cd {$environment->remote->getReleases()}/{$release}&&git log {$environment->code->getActiveCommit()}.. --format='%an'"));
{'fraction_non_alphanumeric': 0.19466035822913147, 'fraction_numerical': 0.0006759040216289286, 'mean_word_length': 4.4411764705882355, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 67, 'https://': 0, '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': '4700686', 'n_tokens_mistral': 936, 'n_tokens_neox': 843, 'n_words': 166}