Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To make Windows drive letter always upper case generates problem in Gatsby? #3

Closed
karland opened this issue Sep 6, 2019 · 2 comments

Comments

@karland
Copy link

karland commented Sep 6, 2019

@caseyWebb

Your repository is a dependency in gatsby. Apparently, you always make the drive letter uppercase:

https://github.com/Profiscience/true-case-path/blob/master/index.js#L56-L58

This causes the following bug: gatsbyjs/gatsby#16758

What is the reason to have uppercase drive letters? I think the Windows default is to have lower case drive letters.

2019-09-06 11 43 12

Thank you very much.

@karland karland changed the title To make Windows drive letter alsway upper case generates problem in Gatsby? To make Windows drive letter alwayd upper case generates problem in Gatsby? Sep 6, 2019
@karland karland changed the title To make Windows drive letter alwayd upper case generates problem in Gatsby? To make Windows drive letter always upper case generates problem in Gatsby? Sep 6, 2019
@caseyWebb
Copy link

caseyWebb commented Sep 6, 2019

Windows is weird (read: stupid). Drive letters are always uppercase (plug in a flash drive, you should see it pop up as D:\ or F:\ in My Computer/This PC), or open My Computer/This PC/Disk Management and see that it's actually C:\. That said, Windows command prompt has some abstractions that try to resolve this, but just make the problem worse (show the correct directory contents, but doesn't correct %cd%). If you cd at any point in the session to c:\, you're locked in the lowercase abstraction until you explicitly cd to a different dir and include the correct drive letter and it can't be into the same actual directory.

Take the following:
2019-09-06-070747_1030x856_scrot

So, knowing that, what I assume has happened is at some point in the shell history before starting gatsby, you've gotten yourself locked into the lowercase abstraction by explicitly cd'ing into the lowercase file path, so gatsby is started with a bogus %cd% env var.

Potential solutions:

  • cd C:\gatsby\dir before starting gatsby, specifying uppercase
  • Use powershell instead of cmd (powershell will redirect to the correct dir and set the env var correctly)
  • Use UNIX file paths and let Windows figure it out (cd /gatsby/dir instead of cd c:\gatsby\dir), but note this will only help if you always use UNIX paths for shell navigation; if you're already in the bogus dir, cmd will not handle it properly.
  • Gatsby could always enforce/assume uppercase drive letters when checking paths

Feel free to re-open this issue if you need more assistance

@karland
Copy link
Author

karland commented Sep 6, 2019

@caseyWebb Thanks for this excellent explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants