===================================================================== Excited to bring V5 to life. This includes some BREAKING CHANGES to several aspects of ZSH-type scwrypts. Please refer to the readme for upgrade details (specifically docs/upgrade/v4-to-v5.md) --- New Features ------------------------- - ZSH testing library with basic mock capabilities - new scwrypts environment file format includes metadata and more advanced features like optional parent env overrides, selection inheritence, and improved structurual flexibility - speedup cache for non-CI runs of ZSH-type scwrypts - ${scwryptsmodule} syntax now allows a consistent unique-naming scheme for functions in ZSH-type scwrypts while providing better insight into origin of API calls in other modules - reusable, case-statement-driven argument parsers in ZSH-type scwrypts --- Changes ------------------------------ - several utility function renames in ZSH-type scwrypts to improve consistency - documentation comments included in ZSH libraries - ZSH-type scwrypts now allow library modules to live alongside executables (zsh/lib still supported; autodetection determines default) --- Bug Fixes ---------------------------- - hardened environment checking for REQUIRED_ENV variables; this removes the ability to overwrite variables in local function contexts
37 lines
1.1 KiB
Bash
37 lines
1.1 KiB
Bash
#####################################################################
|
|
|
|
DEPENDENCIES+=(aws)
|
|
|
|
use cloud/aws/zshparse
|
|
|
|
#####################################################################
|
|
|
|
${scwryptsmodule}() {
|
|
local PARSERS=(cloud.aws.zshparse.overrides)
|
|
local ARGS=()
|
|
local DESCRIPTION="
|
|
Safe context wrapper for aws cli commands; prevents accidental local environment
|
|
bleed-through, but otherwise works exactly like 'aws'. For help with awscli, try
|
|
'AWS [command] help' (no -h or --help)
|
|
|
|
This wrapper should be used in place of _all_ 'aws' usages within scwrypts.
|
|
"
|
|
|
|
eval "$(utils.parse.autosetup)"
|
|
|
|
##########################################
|
|
|
|
echo.debug "invoking '$(echo "$AWS_EVAL_PREFIX" | sed 's/AWS_\(ACCESS_KEY_ID\|SECRET_ACCESS_KEY\)=[^ ]\+ //g')aws ${AWS_CONTEXT_ARGS[@]} ${ARGS[@]}'"
|
|
eval "${AWS_EVAL_PREFIX}aws ${AWS_CONTEXT_ARGS[@]} ${ARGS[@]}"
|
|
}
|
|
|
|
#####################################################################
|
|
|
|
${scwryptsmodule}.parse() {
|
|
return 0 # uses default args parser
|
|
}
|
|
|
|
${scwryptsmodule}.parse.usage() {
|
|
USAGE__args+='\$@ arguments forwarded to the AWS CLI'
|
|
}
|