apply

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package apply provides the command to apply changes to the project.

Index

Constants

This section is empty.

Variables

View Source
var ApplyCmd = &cobra.Command{
	Use:     "apply [--script <file>]",
	Example: `  contextvibes factory apply --script ./plan.json`,
	Args:    cobra.NoArgs,
	RunE: func(cmd *cobra.Command, _ []string) error {
		presenter := ui.NewPresenter(cmd.OutOrStdout(), cmd.ErrOrStderr())
		ctx := cmd.Context()

		scriptContent, _, err := readInput(scriptPath)
		if err != nil {
			presenter.Error("Failed to read input: %v", err)

			return err
		}

		if len(scriptContent) == 0 {
			presenter.Info("Input is empty. Nothing to apply.")

			return nil
		}

		if isJSON(scriptContent) {
			return handleJSONPlan(ctx, presenter, scriptContent)
		}

		return handleShellScript(ctx, presenter, scriptContent)
	},
}

ApplyCmd represents the apply command.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL