--- a/state/state.go Thu Sep 21 19:25:24 2017 -0500
+++ b/state/state.go Thu Sep 21 19:28:42 2017 -0500
@@ -69,12 +69,15 @@
// see if the variable could be expanded into a list.
func (st *State) MapSlice(env, fullEnv []string) ([]string, error) {
+ // If we only have one thing and it looks like $VAR or ${VAR}, then + // see if we have it in the list of things we can expand on the stack. if delimiter, ok := st.getDelimiter(getName(env[0])); ok {
mapped, err := environment.Mapper(env[0], fullEnv)
return strings.SplitN(mapped, delimiter, -1), nil
@@ -82,6 +85,8 @@
return environment.SliceMapper(env, fullEnv)
+// GetDelimiter returns the highest (outermost extend task) delimiter registered +// when a given expandable environment variable. Returns true if found by name. func (st *State) getDelimiter(name string) (string, bool) {
for i := len(st.ExtendFrames) - 1; i >= 0; i-- {
frame := st.ExtendFrames[i]