You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/init.go
+76-28Lines changed: 76 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
package cmd
2
2
3
3
import (
4
+
codacyclient "codacy/cli-v2/codacy-client"
4
5
"codacy/cli-v2/config"
5
6
"codacy/cli-v2/domain"
6
7
"codacy/cli-v2/tools"
@@ -23,20 +24,13 @@ import (
23
24
24
25
constCodacyApiBase="https://app.codacy.com"
25
26
26
-
typeInitFlagsstruct {
27
-
apiTokenstring
28
-
providerstring
29
-
organizationstring
30
-
repositorystring
31
-
}
32
-
33
-
varinitFlagsInitFlags
27
+
varinitFlags domain.InitFlags
34
28
35
29
funcinit() {
36
-
initCmd.Flags().StringVar(&initFlags.apiToken, "api-token", "", "optional codacy api token, if defined configurations will be fetched from codacy")
37
-
initCmd.Flags().StringVar(&initFlags.provider, "provider", "", "provider (gh/bb/gl) to fetch configurations from codacy, required when api-token is provided")
38
-
initCmd.Flags().StringVar(&initFlags.organization, "organization", "", "remote organization name to fetch configurations from codacy, required when api-token is provided")
39
-
initCmd.Flags().StringVar(&initFlags.repository, "repository", "", "remote repository name to fetch configurations from codacy, required when api-token is provided")
30
+
initCmd.Flags().StringVar(&initFlags.ApiToken, "api-token", "", "optional codacy api token, if defined configurations will be fetched from codacy")
31
+
initCmd.Flags().StringVar(&initFlags.Provider, "provider", "", "provider (gh/bb/gl) to fetch configurations from codacy, required when api-token is provided")
32
+
initCmd.Flags().StringVar(&initFlags.Organization, "organization", "", "remote organization name to fetch configurations from codacy, required when api-token is provided")
33
+
initCmd.Flags().StringVar(&initFlags.Repository, "repository", "", "remote repository name to fetch configurations from codacy, required when api-token is provided")
40
34
rootCmd.AddCommand(initCmd)
41
35
}
42
36
@@ -56,7 +50,7 @@ var initCmd = &cobra.Command{
56
50
log.Fatalf("Failed to create tools-configs directory: %v", err)
0 commit comments