cuelang.org/go@v0.10.1/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 the given shell command.
    18  Run: {
    19  	$id: *"tool/exec.Run" | "exec" // exec for backwards compatibility
    20  
    21  	// cmd is the command to run.
    22  	// Simple commands can use a string, which is split by white space characters.
    23  	// If any arguments include white space, use the list form.
    24  	cmd: string | [string, ...string]
    25  
    26  	// dir specifies the working directory of the command.
    27  	// The default is the current working directory.
    28  	dir?: string
    29  
    30  	// env defines the environment variables to use for this system.
    31  	// If the value is a list, the entries mus be of the form key=value,
    32  	// where the last value takes precendence in the case of multiple
    33  	// occurrances of the same key.
    34  	env: {[string]: string} | [...=~"="]
    35  
    36  	// stdout captures the output from stdout if it is of type bytes or string.
    37  	// The default value of null indicates it is redirected to the stdout of the
    38  	// current process.
    39  	stdout: *null | string | bytes
    40  
    41  	// stderr is like stdout, but for errors.
    42  	stderr: *null | string | bytes
    43  
    44  	// stdin specifies the input for the process. If stdin is null, the stdin
    45  	// of the current process is redirected to this command (the default).
    46  	// If it is of typ bytes or string, that input will be used instead.
    47  	stdin: *null | string | bytes
    48  
    49  	// success is set to true when the process terminates with a zero exit
    50  	// code or false otherwise. The user can explicitly specify the value
    51  	// force a fatal error if the desired success code is not reached.
    52  	success: bool
    53  
    54  	// mustSucceed indicates whether a command must succeed, in which case success==false results in a fatal error.
    55  	// This option is enabled by default, but may be disabled to control what is done when a command execution fails.
    56  	mustSucceed: bool | *true
    57  }