I noticed that if you use bass to run a bash script like the following:
function foo() {
local bar="baz"
echo $bar
}
export -f foo
The bash function gets loaded into new_env with a key like BASH_FUNC_foo%% and the value is a string of Bash source code like () { local bar="baz"; echo $bar }.
So bass puts a line like the following into the Fish script:
set -g -x BASH_FUNC_foo%% "() { local bar="baz"; echo $bar }"
This fails when the script is executed for two reasons:
% is not a valid character for a variable name in Fish.
Fish tries to interpolate $ values in the string of Bash source code.
I don't think it makes any sense to copy exported Bash functions, so this PR makes it so that we skip them.
I noticed that if you use bass to run a bash script like the following:
The bash function gets loaded into
new_env
with a key likeBASH_FUNC_foo%%
and the value is a string of Bash source code like() { local bar="baz"; echo $bar }
.So bass puts a line like the following into the Fish script:
This fails when the script is executed for two reasons:
%
is not a valid character for a variable name in Fish.$
values in the string of Bash source code.I don't think it makes any sense to copy exported Bash functions, so this PR makes it so that we skip them.