mirror of
https://github.com/grdl/git-get.git
synced 2026-03-22 20:20:08 +00:00
Fix issues found by wsl linter
This commit is contained in:
@@ -62,6 +62,7 @@ func runGetCommand(cmd *cobra.Command, args []string) error {
|
||||
Root: viper.GetString(cfg.KeyReposRoot),
|
||||
URL: url,
|
||||
}
|
||||
|
||||
return pkg.Get(config)
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ func handleGitGetInvocation() (string, []string) {
|
||||
if len(os.Args) > 1 && (os.Args[1] == "get" || os.Args[1] == "list") {
|
||||
return os.Args[1], os.Args[2:]
|
||||
}
|
||||
|
||||
return "get", os.Args[1:]
|
||||
}
|
||||
|
||||
@@ -44,6 +45,7 @@ func handleDefaultInvocation() (string, []string) {
|
||||
if len(os.Args) > 1 {
|
||||
return os.Args[1], os.Args[2:]
|
||||
}
|
||||
|
||||
return "get", []string{}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,6 +83,7 @@ func TestDetermineCommand(t *testing.T) {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
// Save original os.Args
|
||||
oldArgs := os.Args
|
||||
|
||||
defer func() { os.Args = oldArgs }()
|
||||
|
||||
// Set test args
|
||||
@@ -144,6 +145,7 @@ func TestHandleGitGetInvocation(t *testing.T) {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
// Save original os.Args
|
||||
oldArgs := os.Args
|
||||
|
||||
defer func() { os.Args = oldArgs }()
|
||||
|
||||
// Set test args
|
||||
@@ -187,6 +189,7 @@ func TestHandleGitListInvocation(t *testing.T) {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
// Save original os.Args
|
||||
oldArgs := os.Args
|
||||
|
||||
defer func() { os.Args = oldArgs }()
|
||||
|
||||
// Set test args
|
||||
@@ -236,6 +239,7 @@ func TestHandleDefaultInvocation(t *testing.T) {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
// Save original os.Args
|
||||
oldArgs := os.Args
|
||||
|
||||
defer func() { os.Args = oldArgs }()
|
||||
|
||||
// Set test args
|
||||
@@ -252,4 +256,4 @@ func TestHandleDefaultInvocation(t *testing.T) {
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user