Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Configure fetch destination #8

Open
lukeed opened this issue Feb 27, 2019 · 0 comments
Open

Feat: Configure fetch destination #8

lukeed opened this issue Feb 27, 2019 · 0 comments
Assignees

Comments

@lukeed
Copy link
Owner

lukeed commented Feb 27, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant