Skip to content

Commit

Permalink
[v2] Initial commit of gatsby-plugin-guess-js & gatsby-source-wikiped…
Browse files Browse the repository at this point in the history
…ia (gatsbyjs#5358)

* Add gatsby-source-wikipedia

* Add gatsby-plugin-guess-js

* Only run guess code during builds as can error during development

* Set packages to alpha

* Add more keywords to gatsby-source-wikipedia

* Document plugins
  • Loading branch information
KyleAMathews committed May 10, 2018
1 parent 5f47407 commit 72ffacf
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/create-remote-file-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,14 @@ const requestRemoteNode = (url, headers, tmpFilename, filename) =>
* @param {CreateRemoteFileNodePayload} options
* @return {Promise<Object>} Resolves with the fileNode
*/
async function processRemoteNode({ url, store, cache, createNode, auth = {}, createNodeId }) {
async function processRemoteNode({
url,
store,
cache,
createNode,
auth = {},
createNodeId,
}) {
// Ensure our cache directory exists.
const programDir = store.getState().program.directory
await fs.ensureDir(path.join(programDir, CACHE_DIR, FS_PLUGIN_DIR))
Expand Down Expand Up @@ -260,7 +267,14 @@ const pushTask = task =>
* @param {CreateRemoteFileNodePayload} options
* @return {Promise<Object>} Returns the created node
*/
module.exports = ({ url, store, cache, createNode, auth = {}, createNodeId }) => {
module.exports = ({
url,
store,
cache,
createNode,
auth = {},
createNodeId,
}) => {
// Check if we already requested node for this remote file
// and return stored promise if we did.
if (processingCache[url]) {
Expand Down

0 comments on commit 72ffacf

Please sign in to comment.