* Document git for windows env auto-prefix #481 Signed-off-by: Nenad Strainovic <nenad.strainovic@asseco-see.rs>
This commit is contained in:
		
							parent
							
								
									414f899c28
								
							
						
					
					
						commit
						3ac0cee50a
					
				|  | @ -1,5 +1,13 @@ | ||||||
| # Template Functions | # Template Functions | ||||||
| 
 | 
 | ||||||
|  | #### `env` | ||||||
|  | The `env` function allows you to declare a particular environment variable as an optional for template rendering. | ||||||
|  | If the environment variable is unset or empty, the template rendering will continue with an empty string as a value. | ||||||
|  | 
 | ||||||
|  | ```yaml | ||||||
|  | {{ $envValue := env "envName" }} | ||||||
|  | ``` | ||||||
|  | 
 | ||||||
| #### `requiredEnv` | #### `requiredEnv` | ||||||
| The `requiredEnv` function allows you to declare a particular environment variable as required for template rendering. | The `requiredEnv` function allows you to declare a particular environment variable as required for template rendering. | ||||||
| If the environment variable is unset or empty, the template rendering will fail with an error message. | If the environment variable is unset or empty, the template rendering will fail with an error message. | ||||||
|  | @ -8,6 +16,8 @@ If the environment variable is unset or empty, the template rendering will fail | ||||||
| {{ $envValue := requiredEnv "envName" }} | {{ $envValue := requiredEnv "envName" }} | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
|  | > If the environment variable value starts with '/' (forward slash) and [Git for Windows](https://git-scm.com/download/win) is used, you must set `MSYS_NO_PATHCONV=1` to preserve values as-is, or the environment variable value will be prefixed with the `C:\Program Files\Git`. [reference](https://github.com/git-for-windows/build-extra/blob/main/ReleaseNotes.md#known-issues) | ||||||
|  | 
 | ||||||
| #### `exec` | #### `exec` | ||||||
| The `exec` function allows you to run a command, returning the stdout of the command. When the command fails, the template rendering will fail with an error message. | The `exec` function allows you to run a command, returning the stdout of the command. When the command fails, the template rendering will fail with an error message. | ||||||
| 
 | 
 | ||||||
|  | @ -44,7 +54,7 @@ The `readDir` function returns a list of the relative paths to the files contain | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| #### `readDirEntries` | #### `readDirEntries` | ||||||
| The `readDirEntries` function returns a list of [https://pkg.go.dev/os#DirEntry](DirEntry) contained within the directory | The `readDirEntries` function returns a list of [DirEntry](https://pkg.go.dev/os#DirEntry) contained within the directory | ||||||
| 
 | 
 | ||||||
| ```yaml | ```yaml | ||||||
| {{ range $index,$item := readDirEntries "./testdata/tmpl/sample_folder/" }} | {{ range $index,$item := readDirEntries "./testdata/tmpl/sample_folder/" }} | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue