splor-mg / dpm

Data Package Manager
0 stars 0 forks source link

dpm install adiciona hash do commit ao datapackage.json dos dados baixados #79

Closed labanca closed 2 months ago

labanca commented 2 months ago

closes #74

labanca commented 2 months ago
return {
   "host": parsed_url['host'],
   "user": parsed_url['user'],
   "repo": parsed_url['repo'],
   "ref": parsed_url['ref'],
   "sha": response.json()['sha']
}

A chave na qual o SHA fica gravado muda no response dependendo se for branch ou commit, então precisei adaptar a parte final:

return {
    "host": parsed_url['host'],
    "user": parsed_url['user'],
    "repo": parsed_url['repo'],
    "ref": parsed_url['ref'],
    "sha": response.json()['sha'] if github_endpoint == 'commits' else response.json()['commit']['sha']
}