node-github-download icon indicating copy to clipboard operation
node-github-download copied to clipboard

Retrieve commit hash

Open jnovack opened this issue 9 years ago • 2 comments

Would it be fruitful to return the commit of files that we've downloaded?

I understand I can manually make a timestamp of when I grab the files, however, I'd like the commit hash of the files I've just retrieved.

I would periodically check against the hash (rather than redownload everything) to ensure I am up-to-date.

jnovack avatar Mar 21 '16 14:03 jnovack

I like this idea. I don't pay much attention to the Github API anymore, do you know of an easy way to achieve this?

jprichardson avatar Mar 21 '16 18:03 jprichardson

https://api.github.com/repos/:owner/:repo/commits/master

.sha is the commit hash.

I can see either making another call .getCommit() or returning it from the callback.

jnovack avatar Mar 21 '16 20:03 jnovack