cmd

package
v0.0.0-...-8f1a291 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 License: MIT Imports: 5 Imported by: 0

README

Pukcab module: CMD

Module name: cmd

This module enables you to save the output of a command as a file.

Configuration

Key Type Description
exec_path string The path to the executable to run.
args array An array of arguments to pass to the executable.
env array (Optional) An array of key=value pair strings to append to the current environment variables. Will overwrite any duplicates using the values from this array.
wd string (Optional) The working directory for the executable.
output_name string The name of the output file.
include_stderr bool Optionally include the output of stderr in the artifact.

Example

{
    "name": "cmd",
    "config": {
        "exec_path": "/usr/bin/example",
        "args": ["-C"],
        "env": ["FOO=bar"],
        "wd": "/var/log",
        "output_name": "example.txt"
    }
}

Documentation

Index

Constants

View Source
const Name = "cmd"

Variables

This section is empty.

Functions

This section is empty.

Types

type CmdConfig

type CmdConfig struct {
	ExecPath      string   `json:"exec_path"`
	Args          []string `json:"args"`
	Env           []string `json:"env"`
	Wd            string   `json:"wd"`
	OutputName    string   `json:"output_name"`
	IncludeStderr bool     `json:"include_stderr"`
}

type CmdModule

type CmdModule struct{}

CmdModule the Cmd pukcab module

func (CmdModule) Name

func (m CmdModule) Name() string

func (CmdModule) Run

func (m CmdModule) Run(c interface{}) ([]pukcab.File, error)

Jump to

Keyboard shortcuts

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