cleanup: removed unused code and formatting
This commit is contained in:
parent
df8730463e
commit
135245ca9c
1 changed files with 8 additions and 8 deletions
|
|
@ -158,9 +158,6 @@ var downloadProfileCmd = &cobra.Command{
|
||||||
`,
|
`,
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
Short: "Download a profile",
|
Short: "Download a profile",
|
||||||
// PreRun: func(cmd *cobra.Command, args []string) {
|
|
||||||
// setenv(cmd, "host", "MAKESHIFT_HOST")
|
|
||||||
// },
|
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
var (
|
var (
|
||||||
host, _ = cmd.Flags().GetString("host")
|
host, _ = cmd.Flags().GetString("host")
|
||||||
|
|
@ -217,9 +214,6 @@ var downloadPluginCmd = &cobra.Command{
|
||||||
`,
|
`,
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
Short: "Download a plugin",
|
Short: "Download a plugin",
|
||||||
// PreRun: func(cmd *cobra.Command, args []string) {
|
|
||||||
// setenv(cmd, "host", "MAKESHIFT_HOST")
|
|
||||||
// },
|
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
var (
|
var (
|
||||||
host, _ = cmd.Flags().GetString("host")
|
host, _ = cmd.Flags().GetString("host")
|
||||||
|
|
@ -231,9 +225,14 @@ var downloadPluginCmd = &cobra.Command{
|
||||||
body []byte
|
body []byte
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
for _, pluginName := range args {
|
|
||||||
|
|
||||||
query = fmt.Sprintf("/profile/%s", pluginName)
|
log.Debug().
|
||||||
|
Str("host", host).
|
||||||
|
Str("output", outputPath).
|
||||||
|
Send()
|
||||||
|
|
||||||
|
for _, pluginName := range args {
|
||||||
|
query = fmt.Sprintf("/plugin/%s", pluginName)
|
||||||
res, body, err = c.MakeRequest(client.HTTPEnvelope{
|
res, body, err = c.MakeRequest(client.HTTPEnvelope{
|
||||||
Path: query,
|
Path: query,
|
||||||
Method: http.MethodGet,
|
Method: http.MethodGet,
|
||||||
|
|
@ -241,6 +240,7 @@ var downloadPluginCmd = &cobra.Command{
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error().Err(err).
|
log.Error().Err(err).
|
||||||
Str("host", host).
|
Str("host", host).
|
||||||
|
Str("query", query).
|
||||||
Msg("failed to make request")
|
Msg("failed to make request")
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue