<commit_before>package ci

import (
	"bytes"
	"fmt"
	"log"
	"os"
	"os/exec"
)

// Step is a task to perform during the deployment
type Step struct {
	Command string
	Args    []string
	Stdout  string
	Stderr  string
}

var listCommands []string

func (s *Step) executeCommand() error {
	fmt.Println(s.Command)
	cmd := exec.Command(s.Command, s.Args...)
	stdout, err := cmd.StdoutPipe()
	buf := new(bytes.Buffer)
	if err != nil {
		log.Fatal(err)
	}

	stderr, err := cmd.StderrPipe()
	bufErr := new(bytes.Buffer)
	if err != nil {
		log.Fatal(err)
	}

	if err := cmd.Start(); err != nil {
		log.Fatal(err)
	}

	buf.ReadFrom(stdout)
	bufErr.ReadFrom(stderr)

	if err := cmd.Wait(); err != nil {
		log.Fatal(err)
	}

	s.Stdout = buf.String()
	s.Stderr = bufErr.String()

	return err
}

func initCommandsNewSite(username string, name string, path string) []Step {
	var commands []Step

	commands = append(commands, Step{
		Command: "hugo",
		Args:    []string{"new", "site", path},
		Stdout:  "",
		Stderr:  "",
	})

	commands = append(commands, Step{
		Command: "git",
		Args:    []string{"clone", "<EMAIL>:hbpasti/heather-hugo.git", path + "/themes/heather-hugo"},
		Stdout:  "",
		Stderr:  "",
	})

	commands = append(commands, Step{
		Command: "hugo",<commit_msg>change git protocol<commit_after>package ci

import (
	"bytes"
	"fmt"
	"log"
	"os"
	"os/exec"
)

// Step is a task to perform during the deployment
type Step struct {
	Command string
	Args    []string
	Stdout  string
	Stderr  string
}

var listCommands []string

func (s *Step) executeCommand() error {
	fmt.Println(s.Command)
	cmd := exec.Command(s.Command, s.Args...)
	stdout, err := cmd.StdoutPipe()
	buf := new(bytes.Buffer)
	if err != nil {
		log.Fatal(err)
	}

	stderr, err := cmd.StderrPipe()
	bufErr := new(bytes.Buffer)
	if err != nil {
		log.Fatal(err)
	}

	if err := cmd.Start(); err != nil {
		log.Fatal(err)
	}

	buf.ReadFrom(stdout)
	bufErr.ReadFrom(stderr)

	if err := cmd.Wait(); err != nil {
		log.Fatal(err)
	}

	s.Stdout = buf.String()
	s.Stderr = bufErr.String()

	return err
}

func initCommandsNewSite(username string, name string, path string) []Step {
	var commands []Step

	commands = append(commands, Step{
		Command: "hugo",
		Args:    []string{"new", "site", path},
		Stdout:  "",
		Stderr:  "",
	})

	commands = append(commands, Step{
		Command: "git",
		Args:    []string{"clone", "https://github.com/hbpasti/heather-hugo.git", path + "/themes/heather-hugo"},
		Stdout:  "",
		Stderr:  "",
	})

	commands = append(commands, Step{
		Command: "hugo",
{'fraction_non_alphanumeric': 0.16857030326900355, 'fraction_numerical': 0.0, 'mean_word_length': 3.5276292335115866, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '6103233', 'n_tokens_mistral': 1020, 'n_tokens_neox': 975, 'n_words': 235}