<commit_before>package services

import (
	"encoding/json"
	"io/ioutil"
	"path"

	"github.com/pkg/errors"
	"github.com/yext/edward/home"
)

func LoadRunningServices() ([]ServiceOrGroup, error) {
	dir := home.EdwardConfig.StateDir
	stateFiles, err := ioutil.ReadDir(dir)
	if err != nil {
		return nil, errors.WithStack(err)
	}
	var services []ServiceOrGroup
	for _, file := range stateFiles {
		command := &ServiceCommand{}
		raw, err := ioutil.ReadFile(path.Join(dir, file.Name()))
		if err != nil {
			return nil, errors.WithStack(err)
		}<commit_msg>Ignore directories when identifying which services are currently running.<commit_after>package services

import (
	"encoding/json"
	"io/ioutil"
	"path"

	"github.com/pkg/errors"
	"github.com/yext/edward/home"
)

func LoadRunningServices() ([]ServiceOrGroup, error) {
	dir := home.EdwardConfig.StateDir
	stateFiles, err := ioutil.ReadDir(dir)
	if err != nil {
		return nil, errors.WithStack(err)
	}
	var services []ServiceOrGroup
	for _, file := range stateFiles {
		// Skip directories (these contain instance state)
		if file.IsDir() {
			continue
		}

		command := &ServiceCommand{}
		raw, err := ioutil.ReadFile(path.Join(dir, file.Name()))
		if err != nil {
			return nil, errors.WithStack(err)
		}
{'fraction_non_alphanumeric': 0.13875598086124402, 'fraction_numerical': 0.0, 'mean_word_length': 4.29535864978903, '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': '2724056', 'n_tokens_mistral': 460, 'n_tokens_neox': 431, 'n_words': 101}