cuelang.org/go@v0.13.0/pkg/tool/exec/exec.cue (about)

     1  // Copyright 2018 The CUE Authors
     2  // 
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  // 
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  // 
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package exec
    16  
    17  // Run executes a program with the given arguments.
    18  Run: {
    19  	$id: _id
    20  	_id: *"tool/exec.Run" | "exec" // exec for backwards compatibility
    21  
    22  	// cmd is a non-empty list holding the program name to run
    23  	// and the arguments to be passed to it.
    24  	//
    25  	// Simple commands can use a string, which is split by white space characters.
    26  	// If any arguments include white space, or for clarity, use the list form.
    27  	cmd: string | [string, ...string]
    28  
    29  	// dir specifies the working directory of the command.
    30  	// The default is the current working directory.
    31  	dir?: string
    32  
    33  	// env defines the environment variables to use for this system.
    34  	// If the value is a list, the entries mus be of the form key=value,
    35  	// where the last value takes precendence in the case of multiple
    36  	// occurrances of the same key.
    37  	env: {[string]: string} | [...=~"="]
    38  
    39  	// stdout captures the output from stdout if it is of type bytes or string.
    40  	// The default value of null indicates it is redirected to the stdout of the
    41  	// current process.
    42  	stdout: *null | string | bytes
    43  
    44  	// stderr is like stdout, but for errors.
    45  	stderr: *null | string | bytes
    46  
    47  	// stdin specifies the input for the process. If stdin is null, the stdin
    48  	// of the current process is redirected to this command (the default).
    49  	// If it is of typ bytes or string, that input will be used instead.
    50  	stdin: *null | string | bytes
    51  
    52  	// success is set to true when the process terminates with a zero exit
    53  	// code or false otherwise. The user can explicitly specify the value
    54  	// force a fatal error if the desired success code is not reached.
    55  	success: bool
    56  
    57  	// mustSucceed indicates whether a command must succeed, in which case success==false results in a fatal error.
    58  	// This option is enabled by default, but may be disabled to control what is done when a command execution fails.
    59  	mustSucceed: bool | *true
    60  }