You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You could argue that some are useful to certain people in specific situations -- $AWSUME_STATUS -- but I don't think the $AWSUME_[1-7] vars are useful.
This can be avoided by wrapping the dot-sourced logic in a function and using local variables within that function.
For example:
# Declare entire script in function, call the function, then unset the function
# Allows us to dot-source this script without polluting the shell environment
function __awsume() {
local AWSUME_1 AWSUME_2 # declare local variables
# logic here
}
__awsume "$@"
unset -f __awsume
This also avoids the noise line 183: return: can only return' from a function or sourced scriptwhich is logged whenawsume` is not dot-sourced. I know that error only happens when it's misconfigured and you get the "not being sourced" warning, so maybe not the highest priority.
The text was updated successfully, but these errors were encountered:
The dot-sourced
awsume
shell script leaksAWSUME_*
variables into the host shell session.You could argue that some are useful to certain people in specific situations --
$AWSUME_STATUS
-- but I don't think the$AWSUME_[1-7]
vars are useful.This can be avoided by wrapping the dot-sourced logic in a function and using local variables within that function.
For example:
This also avoids the noise
line 183: return: can only
return' from a function or sourced scriptwhich is logged when
awsume` is not dot-sourced. I know that error only happens when it's misconfigured and you get the "not being sourced" warning, so maybe not the highest priority.The text was updated successfully, but these errors were encountered: