diff --git a/lib/github.js b/lib/github.js index f47d864..780c0a6 100644 --- a/lib/github.js +++ b/lib/github.js @@ -12,22 +12,23 @@ import {error} from './error' const exists = async repoPath => { const apiURL = `https://api.github.com/repos/${repoPath}` + let request + let response try { request = await fetch(apiURL) + response = await request.json() } catch (err) { error(`Not able to check if repo exists - ${err.message}`) return false } - const res = await request.json() - - if (!res.name) { + if (!response.name) { return false } - return res + return response } const downloadRepo = async repoPath => {