Closed prein closed 5 years ago
Hi @prein, thx for opening an issue.
I thought about something like that as well. For example something like:
exec: cp
for_each_in: folder/
to: destination/
or
exec: rm
for:
- folder/file1
- folder/file2
exec
in that case could be any file manipulation linux cmd like: cp
, mv
, rm
, chmod
, etc.
Is that what you think of?
Hi @JulzDiverse
Thanks for taking the time to think about it.
I like the exec
approach.
Would that support multiple exec
calls?
On a minor note: Looking at the example you provided I had an idea for different nesting, although my idea won't be that consistent with how spruce is called. Anyway, let me share my thoughts. I mean doing this for example:
exec:
cp:
for_each_in: folder/
to: destination/
rm:
for:
- folder/file1
- folder/file2
instead of
exec: cp:
for_each_in: folder/
to: destination/
exec: rm:
for:
- folder/file1
- folder/file2
Hi @prein,
I thought a long time about this feature. But I wasn't sure if I really want to add it. Aviator is a tool that should really serve YAML files only. So it was kinda hard to find a good way to integrate such a feature. However, I worked on a "generic" executor, which I think fits good for such use cases. You can define an arbitrary number of generic executors that can execute any installed command/executable. It will be part of the next aviator release (v1.5.0
).
Hey @prein, the new release is now available: https://github.com/JulzDiverse/aviator/releases/tag/v1.5.0
I am managing yaml configs with spruce / aviator but also there are some non-yaml static config files that I am copying along. I imagine this applies to some other peoples workflows as well. It would help greatly if I could do things like copy a list of files from place to place. Something like
for_each
with its properties combined withto_dir
but withoutspruce merge
.