From 5ba772d853f65406c6e44bf86b3806db3e111f11 Mon Sep 17 00:00:00 2001 From: Rodrigo Pombo Date: Thu, 28 Feb 2019 23:57:26 -0300 Subject: [PATCH] Fix build --- package.json | 4 ++-- src/git-providers/bitbucket-commit-fetcher.js | 2 +- src/git-providers/github-commit-fetcher.js | 3 ++- src/git-providers/gitlab-commit-fetcher.js | 3 ++- yarn.lock | 8 ++++---- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 7b85fec..136bf87 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "repository": "pomber/git-history", "private": true, "dependencies": { - "@craco/craco": "^3.4.1", + "@craco/craco": "^3.5.0", "diff": "^4.0.1", "js-base64": "^2.5.1", "netlify-auth-providers": "^1.0.0-alpha5", @@ -18,7 +18,7 @@ }, "scripts": { "start": "craco start", - "build": "react-scripts build", + "build": "craco build", "format": "prettier --write \"**/*.{js,jsx,md,json,html,css,yml}\" --ignore-path .gitignore", "test-prettier": "prettier --check \"**/*.{js,jsx,md,json,html,css,yml}\" --ignore-path .gitignore", "test-cra": "react-scripts test", diff --git a/src/git-providers/bitbucket-commit-fetcher.js b/src/git-providers/bitbucket-commit-fetcher.js index 1042340..1077231 100644 --- a/src/git-providers/bitbucket-commit-fetcher.js +++ b/src/git-providers/bitbucket-commit-fetcher.js @@ -60,7 +60,7 @@ async function getContent(repo, sha, path, token) { if (!contentResponse.ok) { throw { status: contentResponse.status, - body: contentJson + body: await contentResponse.json() }; } diff --git a/src/git-providers/github-commit-fetcher.js b/src/git-providers/github-commit-fetcher.js index f92efd9..fbd990a 100644 --- a/src/git-providers/github-commit-fetcher.js +++ b/src/git-providers/github-commit-fetcher.js @@ -57,6 +57,8 @@ async function getContent(repo, sha, path, token) { return { content: "" }; } + const contentJson = await contentResponse.json(); + if (!contentResponse.ok) { throw { status: contentResponse.status, @@ -64,7 +66,6 @@ async function getContent(repo, sha, path, token) { }; } - const contentJson = await contentResponse.json(); const content = Base64.decode(contentJson.content); return { content, url: contentJson.html_url }; } diff --git a/src/git-providers/gitlab-commit-fetcher.js b/src/git-providers/gitlab-commit-fetcher.js index d2be448..fbecb85 100644 --- a/src/git-providers/gitlab-commit-fetcher.js +++ b/src/git-providers/gitlab-commit-fetcher.js @@ -57,6 +57,8 @@ async function getContent(repo, sha, path, token) { return { content: "" }; } + const contentJson = await contentResponse.json(); + if (!contentResponse.ok) { throw { status: contentResponse.status, @@ -64,7 +66,6 @@ async function getContent(repo, sha, path, token) { }; } - const contentJson = await contentResponse.json(); const content = Base64.decode(contentJson.content); return { content }; } diff --git a/yarn.lock b/yarn.lock index 307b674..451f834 100755 --- a/yarn.lock +++ b/yarn.lock @@ -865,10 +865,10 @@ lodash "^4.17.10" to-fast-properties "^2.0.0" -"@craco/craco@^3.4.1": - version "3.4.1" - resolved "https://registry.yarnpkg.com/@craco/craco/-/craco-3.4.1.tgz#a65e29d7cb661e09e68269ba09ade39d174ec359" - integrity sha512-PVuDx5iLzoYeFrjNUVbblQCGzFyw/DoBBHFI4+JlSCvgEkp07jbBm5fe+z/MqzYJUQm1bFbxe6qbQWI5LFl6XA== +"@craco/craco@^3.5.0": + version "3.5.0" + resolved "https://registry.yarnpkg.com/@craco/craco/-/craco-3.5.0.tgz#698e9f808e4fc5723345a38d8b505a465d885234" + integrity sha512-peQtKgJawPGq5D8qqW2oxkSzCp1wwWL7H8G98Run3UxF5fVJjJLIcnxoRKvXFmrMQYuKBOOsO54ApEeJdTzC0Q== dependencies: cross-spawn "6.0.5" lodash.mergewith "4.6.1"