<commit_before>package cli

import (
	"fmt"
	"os"
	"path"

	log "github.com/Sirupsen/logrus"
	"github.com/bitrise-io/bitrise/colorstring"
	"github.com/codegangsta/cli"
)

var (
	// IsCIMode ...
	IsCIMode = false
)

func before(c *cli.Context) error {
	// Log level
	level, err := log.ParseLevel(c.String(LogLevelKey))
	if err != nil {
		return err
	}

	if err := os.Setenv(LogLevelEnvKey, level.String()); err != nil {
		log.Fatal("Failed to set log level env:", err)
	}
	log.SetLevel(level)

	// CI
	//  if CI mode indicated make sure we set the related env
	//  so all other tools we use will also get it
	if c.Bool(CIKey) {
		if err := os.Setenv("CI", "true"); err != nil {
			return err
		}
		IsCIMode = true
		log.Info(colorstring.Yellow("bitrise runs in CI mode"))
	}
	return nil
}

func printVersion(c *cli.Context) {
	fmt.Fprintf(c.App.Writer, "%v\n", c.App.Version)
}

// Run ...
func Run() {
	// Parse cl
	cli.VersionPrinter = printVersion

	app := cli.NewApp()
	app.Name = path.Base(os.Args[0])
	app.Usage = "Bitrise Automations Workflow Runner"
	app.Version = "0.9.7"

	app.Author = ""
	app.Email = ""

	app.Before = before

	app.Flags = flags
	app.Commands = commands

	if err := app.Run(os.Args); err != nil {
		log.Fatal("Finished with Error:", err)
	}
}<commit_msg>start of v0.9.8<commit_after>package cli

import (
	"fmt"
	"os"
	"path"

	log "github.com/Sirupsen/logrus"
	"github.com/bitrise-io/bitrise/colorstring"
	"github.com/codegangsta/cli"
)

var (
	// IsCIMode ...
	IsCIMode = false
)

func before(c *cli.Context) error {
	// Log level
	level, err := log.ParseLevel(c.String(LogLevelKey))
	if err != nil {
		return err
	}

	if err := os.Setenv(LogLevelEnvKey, level.String()); err != nil {
		log.Fatal("Failed to set log level env:", err)
	}
	log.SetLevel(level)

	// CI
	//  if CI mode indicated make sure we set the related env
	//  so all other tools we use will also get it
	if c.Bool(CIKey) {
		if err := os.Setenv("CI", "true"); err != nil {
			return err
		}
		IsCIMode = true
		log.Info(colorstring.Yellow("bitrise runs in CI mode"))
	}
	return nil
}

func printVersion(c *cli.Context) {
	fmt.Fprintf(c.App.Writer, "%v\n", c.App.Version)
}

// Run ...
func Run() {
	// Parse cl
	cli.VersionPrinter = printVersion

	app := cli.NewApp()
	app.Name = path.Base(os.Args[0])
	app.Usage = "Bitrise Automations Workflow Runner"
	app.Version = "0.9.8"

	app.Author = ""
	app.Email = ""

	app.Before = before

	app.Flags = flags
	app.Commands = commands

	if err := app.Run(os.Args); err != nil {
		log.Fatal("Finished with Error:", err)
	}
}
{'fraction_non_alphanumeric': 0.15912636505460218, 'fraction_numerical': 0.004290171606864275, 'mean_word_length': 3.1437802907915993, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4244157', 'n_tokens_mistral': 1044, 'n_tokens_neox': 1000, 'n_words': 250}