Skip to content

Commit

Permalink
fix: πŸ› crash when not found github repository
Browse files Browse the repository at this point in the history
βœ… Closes: 5
  • Loading branch information
Mikael-R committed Jan 21, 2024
1 parent 286942a commit 40e0c68
Show file tree
Hide file tree
Showing 4 changed files with 1,440 additions and 860 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "readme-template-generator",
"version": "0.9.11",
"version": "0.9.12",
"description": "CLI to help create readme file to document your project",
"private": false,
"repository": {
Expand All @@ -14,7 +14,7 @@
"readme-template",
"readme-template-generator"
],
"author": "Mikael Rolim de Aquino <[email protected]>",
"author": "Mikael Aquino <[email protected]>",
"bugs": {
"url": "https://github.com/Mikael-R/readme-template-generator/issues"
},
Expand All @@ -39,7 +39,7 @@
"license": "MIT",
"dependencies": {
"cfonts": "^2.8.5",
"gluegun": "latest",
"gluegun": "^5.1.6",
"inquirer": "^7.3.3",
"yargs": "^15.4.1"
},
Expand Down
2 changes: 1 addition & 1 deletion src/commands/readme-template-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const command: GluegunCommand = {
showBanner({ text: 'Readme|Template Generator' })

print.warning(
'Project under development, this is a beta version!\n' +
'Project under development, if you see any bug, please report!\n' +
'Contribute: https://github.com/Mikael-R/readme-template-generator\n'
)

Expand Down
4 changes: 2 additions & 2 deletions src/extensions/githubRepoInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ export default (toolbox: ExtendedGluegunToolbox) => {

info.api.index = await (async () => {
const { ok, data } = await api.get(`repos/${info.author}/${info.name}`)
return ok ? data : null
return ok ? data : {}
})()

info.api.contributors = await (async () => {
const { ok, data } = await api.get(
`repos/${info.author}/${info.name}/contributors`
)
return ok ? data : null
return ok ? data : []
})()

return info
Expand Down
Loading

0 comments on commit 40e0c68

Please sign in to comment.