Skip to content

Commit

Permalink
[refactor-runner-adxt-783] runner: Fixed lock warning
Browse files Browse the repository at this point in the history
  • Loading branch information
CelianR committed Dec 11, 2024
1 parent 064978c commit 161b08b
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions components/command/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ type Command interface {
}

type LocalCommand struct {
local.Command
*local.Command
}

type RemoteCommand struct {
remote.Command
*remote.Command
}

var _ Command = &RemoteCommand{}
Expand Down Expand Up @@ -172,7 +172,11 @@ func (r *RemoteRunner) Command(name string, args *Args, opts ...pulumi.ResourceO

cmd, err := remote.NewCommand(r.e.Ctx(), r.namer.ResourceName("cmd", name), args.toRemoteCommandArgs(r.config, r.osCommand), utils.MergeOptions(r.options, opts...)...)

return &RemoteCommand{*cmd}, err
if err != nil {
return &RemoteCommand{cmd}, nil
}

return nil, err
}

func (r *RemoteRunner) NewCopyFile(name string, localPath, remotePath pulumi.StringInput, opts ...pulumi.ResourceOption) (pulumi.Resource, error) {
Expand Down Expand Up @@ -228,7 +232,11 @@ func (r *LocalRunner) Command(name string, args *Args, opts ...pulumi.ResourceOp
opts = utils.MergeOptions[pulumi.ResourceOption](opts, r.e.WithProviders(config.ProviderCommand))
cmd, err := local.NewCommand(r.e.Ctx(), r.namer.ResourceName("cmd", name), args.toLocalCommandArgs(r.config, r.osCommand), opts...)

return &LocalCommand{*cmd}, err
if err != nil {
return &LocalCommand{cmd}, nil
}

return nil, err
}

func (r *LocalRunner) NewCopyFile(name string, localPath, remotePath pulumi.StringInput, opts ...pulumi.ResourceOption) (pulumi.Resource, error) {
Expand Down

0 comments on commit 161b08b

Please sign in to comment.