How to download artifact without path

My artifact is uploaded in a typical step, and downloaded in a subsequent one on a different system, with an included path:

  - command: make stuff
    artifact_paths: '_build/*.pkg'

  - command: |
      buildkite-agent artifact download _build/*.pkg /somewhere/
      mv /somewhere/_build/*.pkg /somewhere/

When I download it, how can I strip the _build/ component? This seems awkwardly not possible today, and risks moving other .pkg files that aren’t related to this job.

Hey @dch

Thanks for reaching out. Can you send a link to the build to support@buildkite.com so I can take a closer look.

Cheers!
Stephanie

Hey @dch
I’m just following up!

I was able to find some builds related to this in your org. The _build/ is the file path to the artifact from the upload step. So if you want to do an artifact download you would need to reference the same path. And because you used *.pkg. it will copy the files in path with the extension. You can give the artifacts a specific name from the upload step so it would be easier to differentiate.

Cheers!