You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: run_pipeline.go
    path of file: ./repos/devspace/cmd
    
    the code of the file until where you have to start completion: package cmd

import (
	"context"
	"fmt"
	"io"
	"os"

	"github.com/loft-sh/devspace/cmd/flags"
	"github.com/loft-sh/devspace/pkg/devspace/build"
	"github.com/loft-sh/devspace/pkg/devspace/config/loader"
	"github.com/loft-sh/devspace/pkg/devspace/config/versions/latest"
	devspacecontext "github.com/loft-sh/devspace/pkg/devspace/context"
	"github.com/loft-sh/devspace/pkg/devspace/context/values"
	"github.com/loft-sh/devspace/pkg/devspace/
    
func (cmd *RunPipelineCmd) Run(cobraCmd *cobra.Command, args []string, f factory.Factory, hookName string) error {
	if len(args) == 0 && cmd.Pipeline == "" {
		return fmt.Errorf("please specify a pipeline through --pipeline or argument")
	} else if len(args) > 0 && cmd.Pipeline == "" {
		cmd.Pipeline = args[0]
		args = args[1:]
	}

	if cmd.Log == nil {
		cmd.Log = f.GetLog()
	}
	if cmd.Silent {
		cmd.Log.SetLevel(logrus.FatalLevel)
	}

	// Print upgrade message if new version available
	if !cmd.Render {
		upgrade.PrintUpgradeMessage(cmd.Log)
	} else if cmd.RenderWriter == nil {
		cmd.RenderWriter = os.Stdout
	}

	if cobraCmd != nil {
		plugin.SetPluginCommand(cobraCmd, args)
	}

	if cmd.Ctx == nil {
		var cancelFn context.CancelFunc
		cmd.Ctx, cancelFn = context.WithCancel(context.Background())
		defer cancelFn()
	}

	// set command in context
	if cobraCmd != nil {
		cmd.Ctx = values.WithCommandFlags(cmd.Ctx, cobraCmd.Flags())
	}
	options := cmd.BuildOptions(cmd.ToConfigOptions())
	ctx, err := initialize(cmd.Ctx, f, options, cmd.Log)
	if err != nil {
		return err
	}

	return runWithHooks(ctx, hookName, func() error {
		return runPipeline(ctx, args, options)
	})
}