9674738792
Expand environment variables used in stowrc, as requested in https://savannah.gnu.org/bugs/?41826 This is achieved by creating a new function expand_environment() that replaces any substring of the form '$VAR' or '${VAR}' with contents of environment variable $VAR. Literal '$' can be given by '\$'. N.B. The function is only applied to the --target and --dir options, and only for options specified in .stowrc; cli options are left untouched. Undefined variables are expanded to the empty string, as they would be in normal shell parameter expansion. Unit tests added accordingly: - Test expand_environment(): * Expand $HOME * Expand ${HOME} * Expand ${WITH SPACE} * Expand '\$HOME'. Expected is '$HOME' * Expand ${UNDEFINED}. Expected is ''. - Test that it's applied to the correct options. - Test that CLI options are not expanded. |
||
---|---|---|
.. | ||
chkstow.t | ||
cleanup_invalid_links.t | ||
cli.t | ||
cli_options.t | ||
defer.t | ||
dotfiles.t | ||
examples.t | ||
find_stowed_path.t | ||
foldable.t | ||
ignore.t | ||
join_paths.t | ||
parent.t | ||
rc_options.t | ||
stow.t | ||
testutil.pm | ||
unstow.t | ||
unstow_orig.t |