Previously I did this using the copy plugin, but that is deprecated:
copy:
plugin: copy
files:
data-dir-wrapper: bin/data-dir-wrapper
I tried to do the same thing with the dump plugin:
wrapper:
plugin: dump
source: .
organize:
data-dir-wrapper: bin/data-dir-wrapper
However this results in every file from source being copied into the snap, which is not what I want.
The documentation for dump says:
In the cases where dumping the content needs some mangling or organizing one would take advantage of the core functionalities available to plugins such as: filesets, stage, snap and organize.
I tried adding a stage: section:
wrapper:
plugin: dump
source: .
stage:
- data-dir-wrapper
organize:
data-dir-wrapper: bin/data-dir-wrapper
But then snapcraft says:
[Errno 2] No such file or directory: ‘/home/al/Source/sigrok-snap-test/parts/wrapper/install/data-dir-wrapper’