Skip to content

Commit 32a741d

Browse files
committed
fix: correct merge conflict resolutions for create.go and install.go
1 parent 55066b9 commit 32a741d

3 files changed

Lines changed: 17 additions & 21 deletions

File tree

cmd/platform/run.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,3 @@ func RunRunCommand(clients *shared.ClientFactory, cmd *cobra.Command, args []str
149149

150150
return nil
151151
}
152-

cmd/project/create.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ var createSubdirFlag string
4242
// TODO - Find best practice, such as using an Interface and Struct to create a client
4343
var CreateFunc = create.Create
4444

45-
var appCreateSpinner *style.Spinner
46-
4745
// promptObject describes the Github app template
4846
type promptObject struct {
4947
Title string // "Reverse string"
@@ -168,12 +166,11 @@ func runCreateCommand(clients *shared.ClientFactory, cmd *cobra.Command, args []
168166
}
169167
clients.EventTracker.SetAppTemplate(template.GetTemplatePath())
170168

171-
appCreateSpinner.Update("Creating app from template", "").Start()
172169
appDirPath, err := CreateFunc(ctx, clients, createArgs)
173170
if err != nil {
174171
return err
175172
}
176-
appCreateSpinner.Update(style.Sectionf(style.TextSection{Emoji: "gear", Text: "Created project directory"}), "").Stop()
173+
177174
printCreateSuccess(ctx, clients, appDirPath)
178175
return nil
179176
}

internal/pkg/apps/install.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -126,26 +126,26 @@ func Install(ctx context.Context, clients *shared.ClientFactory, auth types.Slac
126126
start := time.Now()
127127
switch {
128128
case manifestUpdates:
129-
clients.IO.PrintInfo(ctx, false, "\n%s", style.Sectionf(style.TextSection{
129+
_, _ = clients.IO.WriteOut().Write([]byte("\n" + style.Sectionf(style.TextSection{
130130
Emoji: "books",
131131
Text: "App Manifest",
132132
Secondary: []string{
133133
fmt.Sprintf(`Updated app manifest for "%s" in "%s"`, slackManifest.DisplayInformation.Name, *authSession.TeamName),
134134
},
135-
}))
135+
})))
136136
clients.IO.PrintDebug(ctx, "updating app %s", app.AppID)
137137
_, err := apiInterface.UpdateApp(ctx, token, app.AppID, manifest, clients.Config.ForceFlag, true)
138138
if err != nil {
139139
return app, "", err
140140
}
141141
case manifestCreates:
142-
clients.IO.PrintInfo(ctx, false, "%s", style.Sectionf(style.TextSection{
142+
_, _ = clients.IO.WriteOut().Write([]byte(style.Sectionf(style.TextSection{
143143
Emoji: "books",
144144
Text: "App Manifest",
145145
Secondary: []string{
146146
fmt.Sprintf(`Creating app manifest for "%s" in "%s"`, slackManifest.DisplayInformation.Name, *authSession.TeamName),
147147
},
148-
}))
148+
})))
149149
clients.IO.PrintDebug(ctx, "app not found so creating a new app")
150150
result, err := apiInterface.CreateApp(ctx, token, manifest, false)
151151
if err != nil {
@@ -207,13 +207,13 @@ func Install(ctx context.Context, clients *shared.ClientFactory, auth types.Slac
207207
outgoingDomains = *manifest.OutgoingDomains
208208
}
209209

210-
clients.IO.PrintInfo(ctx, false, "\n%s", style.Sectionf(style.TextSection{
210+
_, _ = clients.IO.WriteOut().Write([]byte("\n" + style.Sectionf(style.TextSection{
211211
Emoji: "house",
212212
Text: "App Install",
213213
Secondary: []string{
214214
fmt.Sprintf(`Installing "%s" app to "%s"`, manifest.DisplayInformation.Name, *authSession.TeamName),
215215
},
216-
}))
216+
})))
217217
// Note - we use DeveloperAppInstall endpoint for both local (dev) runs
218218
// and hosted installs https://github.com/slackapi/slack-cli/pull/456#discussion_r830272175
219219

@@ -245,9 +245,9 @@ func Install(ctx context.Context, clients *shared.ClientFactory, auth types.Slac
245245
err = updateIcon(ctx, clients, iconPath, app.AppID, token)
246246
if err != nil {
247247
clients.IO.PrintDebug(ctx, "icon error: %s", err)
248-
clients.IO.PrintInfo(ctx, false, "%s", style.SectionSecondaryf("Error updating app icon: %s", err))
248+
_, _ = clients.IO.WriteOut().Write([]byte(style.SectionSecondaryf("Error updating app icon: %s", err)))
249249
} else {
250-
clients.IO.PrintInfo(ctx, false, "%s", style.SectionSecondaryf("Updated app icon: %s", iconPath))
250+
_, _ = clients.IO.WriteOut().Write([]byte(style.SectionSecondaryf("Updated app icon: %s", iconPath)))
251251
}
252252
// TODO: Optimization.
253253
// Save a md5 hash of the icon in environments.yaml
@@ -261,7 +261,7 @@ func Install(ctx context.Context, clients *shared.ClientFactory, auth types.Slac
261261
// update config with latest yaml hash
262262
// env.Hash = slackYaml.Hash
263263

264-
clients.IO.PrintInfo(ctx, false, "%s", style.SectionSecondaryf("Finished in %.1fs", time.Since(start).Seconds()))
264+
_, _ = clients.IO.WriteOut().Write([]byte(style.SectionSecondaryf("Finished in %.1fs", time.Since(start).Seconds())))
265265

266266
return app, types.InstallSuccess, nil
267267
}
@@ -447,27 +447,27 @@ func InstallLocalApp(ctx context.Context, clients *shared.ClientFactory, orgGran
447447
start := time.Now()
448448
switch {
449449
case manifestUpdates:
450-
clients.IO.PrintInfo(ctx, false, "\n%s", style.Sectionf(style.TextSection{
450+
_, _ = clients.IO.WriteOut().Write([]byte("\n" + style.Sectionf(style.TextSection{
451451
Emoji: "books",
452452
Text: "App Manifest",
453453
Secondary: []string{
454454
fmt.Sprintf(`Updated app manifest for "%s" in "%s"`, slackManifest.DisplayInformation.Name, *authSession.TeamName),
455455
},
456-
}))
456+
})))
457457
clients.IO.PrintDebug(ctx, "updating app %s", app.AppID)
458458
_, err := apiInterface.UpdateApp(ctx, token, app.AppID, manifest, clients.Config.ForceFlag, true)
459459
if err != nil {
460460
clients.IO.PrintDebug(ctx, "failed updating app %s: %s", app.AppID, err)
461461
return app, api.DeveloperAppInstallResult{}, "", err
462462
}
463463
case manifestCreates:
464-
clients.IO.PrintInfo(ctx, false, "%s", style.Sectionf(style.TextSection{
464+
_, _ = clients.IO.WriteOut().Write([]byte(style.Sectionf(style.TextSection{
465465
Emoji: "books",
466466
Text: "App Manifest",
467467
Secondary: []string{
468468
fmt.Sprintf(`Creating app manifest for "%s" in "%s"`, slackManifest.DisplayInformation.Name, *authSession.TeamName),
469469
},
470-
}))
470+
})))
471471
clients.IO.PrintDebug(ctx, "app not found so creating a new app")
472472
result, err := apiInterface.CreateApp(ctx, token, manifest, false)
473473
if err != nil {
@@ -530,13 +530,13 @@ func InstallLocalApp(ctx context.Context, clients *shared.ClientFactory, orgGran
530530
outgoingDomains = *manifest.OutgoingDomains
531531
}
532532

533-
clients.IO.PrintInfo(ctx, false, "\n%s", style.Sectionf(style.TextSection{
533+
_, _ = clients.IO.WriteOut().Write([]byte("\n" + style.Sectionf(style.TextSection{
534534
Emoji: "house",
535535
Text: "App Install",
536536
Secondary: []string{
537537
fmt.Sprintf(`Installing "%s" app to "%s"`, manifest.DisplayInformation.Name, *authSession.TeamName),
538538
},
539-
}))
539+
})))
540540
var installState types.InstallState
541541
result, installState, err := apiInterface.DeveloperAppInstall(ctx, clients.IO, token, app, botScopes, outgoingDomains, orgGrantWorkspaceID, clients.Config.AutoRequestAAAFlag)
542542

@@ -582,7 +582,7 @@ func InstallLocalApp(ctx context.Context, clients *shared.ClientFactory, orgGran
582582
// update config with latest yaml hash
583583
// env.Hash = slackYaml.Hash
584584

585-
clients.IO.PrintInfo(ctx, false, "%s", style.SectionSecondaryf("Finished in %.1fs", time.Since(start).Seconds()))
585+
_, _ = clients.IO.WriteOut().Write([]byte(style.SectionSecondaryf("Finished in %.1fs", time.Since(start).Seconds())))
586586

587587
return app, result, types.InstallSuccess, nil
588588
}

0 commit comments

Comments
 (0)