Skip to content

Commit

Permalink
fix: file paths
Browse files Browse the repository at this point in the history
  • Loading branch information
dd84ai committed Feb 11, 2024
1 parent 60e4f7e commit 86cded3
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion interface_cli/actions/about.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
func About() string {
var sb strings.Builder
sb.WriteString("OK ")
sb.WriteString("github.com/darklab8/autogit version: ")
sb.WriteString("autogit version: ")
sb.WriteString(settings.GetAutogitVersion())
sb.WriteString("\n")
return sb.String()
Expand Down
2 changes: 1 addition & 1 deletion interface_cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "github.com/darklab8/autogit",
Use: "autogit",
Short: "Git tool for validation of conventional commits, changelog generation and semantic version generation",
// Uncomment the following line if your bare application
// has an action associated with it:
Expand Down
2 changes: 1 addition & 1 deletion interface_cli/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (s *sharedFlags) Bind(Cmd *cobra.Command) {

func (s *sharedFlags) Run() {
if *(s.verboseLogging) {
logus.Log = typelog.NewLogger("github.com/darklab8/autogit", typelog.WithLogLevel(typelog.LEVEL_DEBUG))
logus.Log = typelog.NewLogger("autogit", typelog.WithLogLevel(typelog.LEVEL_DEBUG))
}
logus.Log.Debug(fmt.Sprintf("verbose=%t\n", *(s.verboseLogging)))
}
Expand Down
3 changes: 2 additions & 1 deletion semanticgit/git/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/darklab8/autogit/settings/envs"
"github.com/darklab8/autogit/settings/logus"
"github.com/darklab8/autogit/settings/types"
"github.com/darklab8/go-typelog/typelog"

"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/config"
Expand Down Expand Up @@ -182,7 +183,7 @@ func (r *Repository) PushTag(name types.TagName) {
sshPath := filepath.Join(string(envs.PathUserHome), ".ssh", string(r.sshPath))
sshKey, _ := os.ReadFile(sshPath)
publicKey, keyError := ssh.NewPublicKeys("git", []byte(sshKey), "")
logus.Log.CheckFatal(keyError, "failed initializing git ssh keys")
logus.Log.CheckFatal(keyError, "failed initializing git ssh keys", typelog.String("key_path", string(sshPath)))

refs := []config.RefSpec{
config.RefSpec("+refs/tags/" + name + ":refs/tags/" + name),
Expand Down
6 changes: 3 additions & 3 deletions settings/changelog.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ type ChangelogScheme struct {

func (conf ConfigScheme) changelogValidate() {
if conf.Changelog.CommitURL == "" {
logus.Log.Fatal("github.com/darklab8/autogit.yml->Changelog.CommitUrl is empty")
logus.Log.Fatal("autogit.yml->Changelog.CommitUrl is empty")
}
if conf.Changelog.CommitRangeURL == "" {
logus.Log.Fatal("github.com/darklab8/autogit.yml->Changelog.CommitRangeURL is empty")
logus.Log.Fatal("autogit.yml->Changelog.CommitRangeURL is empty")
}
if conf.Changelog.IssueURL == "" {
logus.Log.Fatal("github.com/darklab8/autogit.yml->Changelog.IssueURL is empty")
logus.Log.Fatal("autogit.yml->Changelog.IssueURL is empty")
}
}
2 changes: 1 addition & 1 deletion settings/logus/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ package logus
import "github.com/darklab8/go-typelog/typelog"

var (
Log *typelog.Logger = typelog.NewLogger("github.com/darklab8/autogit")
Log *typelog.Logger = typelog.NewLogger("autogit")
)
10 changes: 5 additions & 5 deletions settings/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"gopkg.in/yaml.v3"
)

const ToolName = "github.com/darklab8/autogit"
const ToolName = "autogit"

var HookFolderName = fmt.Sprintf(".%s-hooks", ToolName)

Expand Down Expand Up @@ -53,7 +53,7 @@ type ConfigScheme struct {

// var ProjectConfigPath types.ConfigPath

const ConfigFileName types.ConfigPath = "github.com/darklab8/autogit.yml"
const ConfigFileName types.ConfigPath = "autogit.yml"

var cachedConfigFile []byte = []byte{}

Expand Down Expand Up @@ -167,7 +167,7 @@ func configRead(file []byte) *ConfigScheme {
err = yaml.Unmarshal(merged_config_as_bytes, &config)
logus.Log.CheckError(err, `unable to unmarshal merged config.
Your autogit.yml settings file is having invalue key: value pairs.
Try to remove previous autogit.yml settings files and generate a new one with "github.com/darklab8/autogit init [--global] command"`)
Try to remove previous autogit.yml settings files and generate a new one with "autogit init [--global] command"`)

return &config
}
Expand Down Expand Up @@ -197,9 +197,9 @@ func check_file_is_not_having_invalid[T comparable](example map[T]interface{}, c

// if key is present in additions hasmap
if example_value, is_present := example[checkable_key]; !is_present {
logus.Log.Error(fmt.Sprintf(`autogit.yml file is having not allowed user settings key
logus.Log.Error(`autogit.yml file is having not allowed user settings key
Please, remove previous autogit.yml local in your repository and user global one and generate new one
with "github.com/darklab8/autogit init [--global]" command :). Or remove the specified "settings_key"`), logus.SettingsKey(checkable_key))
with "autogit init [--global]" command :). Or remove the specified "settings_key"`, logus.SettingsKey(checkable_key))
} else {
if reflect.TypeOf(example_value) != reflect.TypeOf(checkable_value) {
logus.Log.Fatal(fmt.Sprintf(
Expand Down
2 changes: 1 addition & 1 deletion settings/testutils/fixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func FixtureSettings() {
workdir := utils.GetCurrentFolder()
originalSettingsPath := workdir
rootFolder := filepath.Dir(string(originalSettingsPath))
testSettingsPath := types.ConfigPath(filepath.Join(rootFolder, "settings", "github.com/darklab8/autogit.example.yml"))
testSettingsPath := types.ConfigPath(filepath.Join(rootFolder, "settings", "autogit.example.yml"))

settings.NewConfig(testSettingsPath)
}

0 comments on commit 86cded3

Please sign in to comment.