lukeed/gittar

Feat: Configure `fetch` destination

Opened this issue · 0 comments

Should add a new target option for the gittar.fetch method.

It should be a function that receives all the components from the parser ({ site, repo, type }) so that you have all the same information that gittar would use to compose a location.

When left unspecified, gittar will default to its current destination(s). But this gives a window for the caller to fully customize where the tarball is placed.

gittar.fetch('foo/bar', {
  target(info) {
    return path.join(__dirname, info.repo + '.tar.gz')
  }
})

This is a non-breaking way to handle #7. It also handles #5 in a different way.