shell

package
v1.1.76-nightly Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2025 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CheckCmd = &cobra.Command{
	Use:    "checkchanges",
	Hidden: true,
	Run: func(cmd *cobra.Command, args []string) {
		ck, err := getCache()
		if err != nil || ck.Hash != os.Getenv("KL_HASH") {
			if err == fileclient.KLYamlNotFound {
				fmt.Printf("(kl - %s)", text.Yellow("outside"))
				return
			}
			fmt.Printf("(kl - %s)", text.Yellow("reload needed"))
			return
		}

		depth := 0
		s, ok := os.LookupEnv("KL_DEPTH")
		if ok {
			i, err := strconv.Atoi(s)
			if err == nil {
				depth = i
			}
		}
		if depth > 1 {
			fmt.Printf("%s%s%s", text.Blue("(kl"), text.Yellow(strings.Repeat(">", depth-1)), text.Blue(")"))
			return
		}

		fmt.Printf(text.Blue("(kl)"))
		return
	},
}
View Source
var Cmd = &cobra.Command{
	Use:    "shell",
	Short:  "",
	Hidden: envclient.IsBoxMode(),
	Run: func(cmd *cobra.Command, args []string) {
		if err := Shell(cmd, args); err != nil {
			fn.PrintError(err)
		}
	},
}
View Source
var ErrHashMismatch = fn.Errorf("hash mismatch")

Functions

func NixShell

func NixShell(cmd *cobra.Command, args ShellArgs) error

func Shell

func Shell(cmd *cobra.Command, args []string) error

Types

type ShellArgs

type ShellArgs struct {
	OnlyPrint bool
	RawExport bool
	ShellData *fileclient.ShellData
	Shell     string
	EnvVars   []string
	Packages  []string
	Libraries []string
}

Jump to

Keyboard shortcuts

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