You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It took me a while to figure this one out, so bear with the long description.
I am currently using gatsby-source-git to source MD files from another Git repo. We'll call this Content repo. Now I've already cloned the Content repo on my local.
When running gatsby develop, it fails with an error:
ERROR
localPath is not defined
This kind of throws a wrench into the whole debugging process. Like, WTF is localPath. Thankfully, it took little time to figure that out.
throw new Error(`Can't clone to target destination: ${localPath}`);
localPath is being used outside of it's scope. Classic JS scope issue! 🤦🏽 Fixed this line, and now started getting the expected output, Can't clone to target destination: ...
Now, since I already have the repo cloned, it shouldn't fail with the clone again. I was stumped as to why the clone was failing. So I started debugging isAlreadyCloned method. Lo and Behold, the remote were different. Same, but different.
So obviously, the equality check failed, because I am a dumb genius who prefers ssh over https remotes. 🥇
I also found out the hard way, that the plugin overrides local changes and always prefers remote changes. I am not sure why it does that, but I'll be investigating more on this.
What should be done?
Mention something in the README that this plugin clones using whatever remote option is specified. So it's upto the user to make sure that the remote urls are in sync. And that the plugin overrrides the content on every gatsby develop
Kick-ass plugin btw. Thank you! 🍻
The text was updated successfully, but these errors were encountered:
It took me a while to figure this one out, so bear with the long description.
I am currently using
gatsby-source-git
to source MD files from another Git repo. We'll call thisContent
repo. Now I've already cloned theContent
repo on my local.I've configured
gatsby-source-git
as follows:When running
gatsby develop
, it fails with an error:This kind of throws a wrench into the whole debugging process. Like, WTF is
localPath
. Thankfully, it took little time to figure that out.localPath
is being used outside of it's scope. Classic JS scope issue! 🤦🏽 Fixed this line, and now started getting the expected output,Can't clone to target destination: ...
Now, since I already have the repo cloned, it shouldn't fail with the clone again. I was stumped as to why the clone was failing. So I started debugging
isAlreadyCloned
method. Lo and Behold, the remote were different. Same, but different.So obviously, the equality check failed, because I am a dumb genius who prefers ssh over https remotes. 🥇
I also found out the hard way, that the plugin overrides local changes and always prefers remote changes. I am not sure why it does that, but I'll be investigating more on this.
What should be done?
Mention something in the README that this plugin clones using whatever
remote
option is specified. So it's upto the user to make sure that the remote urls are in sync. And that the plugin overrrides the content on everygatsby develop
Kick-ass plugin btw. Thank you! 🍻
The text was updated successfully, but these errors were encountered: