1

I have a file I want to copy from my snapcraft source into the .snap I am building:

parts:
   foo-config:
      plugin: dump
      source: .
      stage:
        - etc/foo.conf

If I try and build the snap and the etc/ directory does not exist I get an error. Is there a way to use the dump plugin (or otherwise) to create directories as well as copying files?

1

stage is going to look for parts/$partname/install/etc/foo.conf. If you want to move foo.conf from some other directory and have it in $SNAP/etc/foo.conf, you'll need to use organize. organize will create the needed directories.

parts:
    foo-config:
        plugin: dump
        source: .
        stage:
          - etc/foo.conf
        organize:
           <path>/foo: etc/foo.conf

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.