mirror of
https://github.com/Slug-Boi/cocommit.git
synced 2026-05-13 12:45:47 +00:00
fix: attempt to fix cmd tests
This commit is contained in:
+1
-3
@@ -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
@@ -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()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user