Add "mo" from "https://git.knownelement.com/ExternalVendorCode/mo.git@master"
git-vendor-name: mo git-vendor-dir: vendor/git.knownelement.com/ExternalVendorCode/mo git-vendor-repository: https://git.knownelement.com/ExternalVendorCode/mo.git git-vendor-ref: master
This commit is contained in:
		
							
								
								
									
										31
									
								
								vendor/git.knownelement.com/ExternalVendorCode/mo/demo/function-args
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										31
									
								
								vendor/git.knownelement.com/ExternalVendorCode/mo/demo/function-args
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,31 @@
 | 
			
		||||
#!/usr/bin/env bash
 | 
			
		||||
#
 | 
			
		||||
# This sources a simple script with the env. variables needed for the template.
 | 
			
		||||
 | 
			
		||||
cd "$(dirname "$0")" # Go to the script's directory
 | 
			
		||||
source ../mo
 | 
			
		||||
 | 
			
		||||
export NAME="Alex"
 | 
			
		||||
export ARRAY=( AAA BBB CCC )
 | 
			
		||||
 | 
			
		||||
# Include an external template
 | 
			
		||||
INCLUDE() {
 | 
			
		||||
    # shellcheck disable=SC2031
 | 
			
		||||
    cat "${MO_FUNCTION_ARGS[0]}"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Print section title
 | 
			
		||||
TITLE() {
 | 
			
		||||
    echo "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+"
 | 
			
		||||
    # shellcheck disable=SC2031
 | 
			
		||||
    echo "${MO_FUNCTION_ARGS[0]}"
 | 
			
		||||
    echo "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
cat <<EOF | mo -u
 | 
			
		||||
{{TITLE 'Part 1'}}
 | 
			
		||||
{{INCLUDE 'function-args-part1'}}
 | 
			
		||||
 | 
			
		||||
{{TITLE 'Part 2'}}
 | 
			
		||||
{{INCLUDE 'function-args-part2'}}
 | 
			
		||||
EOF
 | 
			
		||||
		Reference in New Issue
	
	Block a user