cmd

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunCmdAndStream

func RunCmdAndStream(
	cmd *exec.Cmd,
) error

Attaches the current CLI to the specified command. This allows the user to interact with the command as if it was run directly from the CLI.

If the user presses **Ctrl+C**, this function signals the command is being attached to, to terminate. That way, the command will not keep running in the background.

Example:

RunCmdAndStream(exec.Command("packer.exe", "build", "."))

`==> test.amazon-ebs.ubuntu: Prevalidating AMI Name: test`
`==> test.amazon-ebs.ubuntu: Found Image ID: ami-03f65b8614a860c29`
`==> test.amazon-ebs.ubuntu: Creating temporary keypair: packer_64b824bb-026f-af2c-184e-7097c138d520`

func TerminateCommand

func TerminateCommand(cmd *exec.Cmd)

Terminates the specified command. This command should not return an error and should not rely on external packages, this is in order to avoid additional error handling. It is the end of the line.

Types

This section is empty.

Jump to

Keyboard shortcuts

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