shellexec

package
v0.29.2 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package shellexec builds the *exec.Cmd that runs a command line through the user's shell. Every "run this string as a shell command" path in sprout goes through here so the shell choice is made in one place.

Unix honors $SHELL and falls back to /bin/sh. Windows has neither: it prefers a POSIX shell (Git for Windows' bash) because the agent writes POSIX command lines, and falls back to cmd.exe when none is installed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(command string) *exec.Cmd

Command returns an *exec.Cmd that runs command through the user's shell.

func CommandContext

func CommandContext(ctx context.Context, command string) *exec.Cmd

CommandContext is Command bound to ctx (the process is killed when ctx ends).

func Path

func Path() string

Path returns the POSIX shell used to run commands: $SHELL, else /bin/sh.

func ScriptCommandContext

func ScriptCommandContext(ctx context.Context, path string) *exec.Cmd

ScriptCommandContext runs the script at path with the user's shell.

Types

This section is empty.

Jump to

Keyboard shortcuts

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