fix: attempt to fix cmd tests

This commit is contained in:
Slug-Boi
2025-06-03 20:12:15 +02:00
parent f4cb12741f
commit 84de8e1e4e
2 changed files with 5 additions and 4 deletions
+1 -3
View File
@@ -6,8 +6,6 @@ import (
"os" "os"
"strings" "strings"
"testing" "testing"
"github.com/Slug-Boi/cocommit/src/cmd/utils"
) )
const author_data = ` const author_data = `
@@ -34,7 +32,7 @@ const author_data = `
} }
}` }`
var envVar = utils.Find_authorfile() var envVar string
func setup() { func setup() {
// setup test data // setup test data
+4 -1
View File
@@ -12,7 +12,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
var authorfile = utils.Find_authorfile() var authorfile string
// usersCmd represents the users command // usersCmd represents the users command
func UsersCmd() *cobra.Command { func UsersCmd() *cobra.Command {
@@ -21,6 +21,9 @@ func UsersCmd() *cobra.Command {
Short: "Displays all users from the author file located at:\n" + authorfile, Short: "Displays all users from the author file located at:\n" + authorfile,
Long: `Displays all users from the author file located at:` + "\n" + authorfile, Long: `Displays all users from the author file located at:` + "\n" + authorfile,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
if authorfile == "" {
authorfile = utils.Find_authorfile()
}
if update { if update {
update_msg() update_msg()
} }