MCPcopy Create free account
hub / github.com/Scalingo/cli / Update

Function Update

integrationlink/update.go:13–36  ·  view source on GitHub ↗
(ctx context.Context, app string, params scalingo.SCMRepoLinkUpdateParams)

Source from the content-addressed store, hash-verified

11)
12
13func Update(ctx context.Context, app string, params scalingo.SCMRepoLinkUpdateParams) error {
14 if app == "" {
15 return errors.New(ctx, "no app defined")
16 }
17
18 c, err := config.ScalingoClient(ctx)
19 if err != nil {
20 return errors.Wrapf(ctx, err, "fail to get Scalingo client")
21 }
22
23 _, err = c.SCMRepoLinkUpdate(ctx, app, params)
24 if err != nil {
25 if !utils.IsPaymentRequiredAndFreeTrialExceededError(err) {
26 return errors.Wrapf(ctx, err, "fail to update integration link")
27 }
28
29 return utils.AskAndStopFreeTrial(ctx, c, func() error {
30 return Update(ctx, app, params)
31 })
32 }
33
34 io.Statusf("Your app '%s' integration link has been updated.\n", app)
35 return nil
36}

Callers 1

Calls 4

ScalingoClientFunction · 0.92
AskAndStopFreeTrialFunction · 0.92
StatusfFunction · 0.92

Tested by

no test coverage detected