This change allows the load operator to work on references, as well as
fixes a bug that breaks on absolute paths.
This allows loads that build the path using environment variables, which
is my use case, or using paths based on components supplied in other
merged files.
Fixes #284
Validation:
~/code/src/github.com/geofffranks/spruce ∴ cat > users.yml
- name: bob
color: green
- name: fred
color: red
^D
~/code/src/github.com/geofffranks/spruce ∴ cat > main.yml
meta:
path: (( concat $PWD "/users.yml" ))
params:
users: (( load meta.path ))
^D
~/code/src/github.com/geofffranks/spruce ∴ /usr/local/bin/spruce merge main.yml
1 error(s) detected:
- $.params.users: load operator only expects one literal argument (quoted string)
~/code/src/github.com/geofffranks/spruce ∴ ./spruce merge main.yml
meta:
path: /Users/dbell/code/src/github.com/geofffranks/spruce/users.yml
params:
users:
- color: green
name: bob
- color: red
name: fred
~/code/src/github.com/geofffranks/spruce ∴ cat > fail.yml
params:
users: (( load "/Users/dbell/code/src/github.com/geofffranks/spruce/users.yml" ))
^D
~/code/src/github.com/geofffranks/spruce ∴ /usr/local/bin/spruce merge fail.yml
1 error(s) detected:
- $.params.users: Get /Users/dbell/code/src/github.com/geofffranks/spruce/users.yml: unsupported protocol scheme ""
~/code/src/github.com/geofffranks/spruce ∴ ./spruce merge fail.yml
params:
users:
- color: green
name: bob
- color: red
name: fred
This change allows the load operator to work on references, as well as fixes a bug that breaks on absolute paths.
This allows loads that build the path using environment variables, which is my use case, or using paths based on components supplied in other merged files.
Fixes #284
Validation: