<commit_before>package config

import (
	"github.com/d-bf/client/dbf"
	"os"
	"path/filepath"
)

var (
	CurrentPath string
	confPath    string
)

func init() {
	// Set current path
	var err error
	CurrentPath, err = filepath.Abs(filepath.Dir(os.Args[0]))
	if err == nil {
		CurrentPath += string(os.PathSeparator)
	} else {
		dbf.Log.Printf("%s\n", err)
		os.Exit(1)
	}
}

func Check() {
	// Check config dir
	confPath = CurrentPath + "conf" + string(os.PathSeparator)
	if _, err := os.Stat(confPath); err != nil {
		if os.IsNotExist(err) { // Does not exist, so create it
			if err = os.MkdirAll(confPath, 0775); err != nil {
				dbf.Log.Printf("Error 2.2: %s\n", err) // Error in creating
				os.Exit(1)
			}
		} else {
			dbf.Log.Printf("%s\n", err) // Error in accessing
			os.Exit(1)
		}
	}

	// Check config file
	confPath = confPath + "dbf.json"
	if _, err := os.Stat(confPath); err != nil {
		if os.IsNotExist(err) { // Does not exist, so create it
			// Create initial config file
			createDbfConf()
		} else {
			dbf.Log.Printf("%s\n", err) // Error in accessing
			os.Exit(1)
		}
	} else {
		// Sync dbf config
	}
}<commit_msg>Exit to enter server's url after initial config file creation<commit_after>package config

import (
	"fmt"
	"github.com/d-bf/client/dbf"
	"os"
	"path/filepath"
)

var (
	CurrentPath string
	confPath    string
)

func init() {
	// Set current path
	var err error
	CurrentPath, err = filepath.Abs(filepath.Dir(os.Args[0]))
	if err == nil {
		CurrentPath += string(os.PathSeparator)
	} else {
		dbf.Log.Printf("%s\n", err)
		os.Exit(1)
	}
}

func Check() {
	// Check config dir
	confPath = CurrentPath + "conf" + string(os.PathSeparator)
	if _, err := os.Stat(confPath); err != nil {
		if os.IsNotExist(err) { // Does not exist, so create it
			if err = os.MkdirAll(confPath, 0775); err != nil {
				dbf.Log.Printf("Error 2.2: %s\n", err) // Error in creating
				os.Exit(1)
			}
		} else {
			dbf.Log.Printf("%s\n", err) // Error in accessing
			os.Exit(1)
		}
	}

	// Check config file
	confPath = confPath + "dbf.json"
	if _, err := os.Stat(confPath); err != nil {
		if os.IsNotExist(err) { // Does not exist, so create it
			// Create initial config file
			err = createDbfConf()
			if err == nil {
				fmt.Printf("Please enter server's URL in url_api in config file: %s\n", confPath)
				os.Exit(0)
			} else {
				dbf.Log.Printf("%s\n", err)
				os.Exit(1)
			}
		} else {
			dbf.Log.Printf("%s\n", err) // Error in accessing
			os.Exit(1)
		}
	} else {
		// Sync dbf config
	}
}
{'fraction_non_alphanumeric': 0.15998412068281065, 'fraction_numerical': 0.009527590313616514, 'mean_word_length': 2.806646525679758, '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': '7413349', 'n_tokens_mistral': 1077, 'n_tokens_neox': 991, 'n_words': 248}