pecan-waffle icon indicating copy to clipboard operation
pecan-waffle copied to clipboard

add-project PathTooLongException

Open MikaelPorttila opened this issue 9 years ago • 5 comments

Hi! I really like pecan-waffle and planning to use it on all of my template projects, but today I ran into this "path is too long"-exception (Windows has never been a fan of long paths). I could easily build a workaround by excluding my jspm-package folder but i think this kind of tool should be able to handle even the craziest of paths so I'll report it as an issue. :)

*Error message: * Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the d irectory name must be less than 248 characters. At C:\Users\x\Documents\WindowsPowerShell\Modules\pecan-waffle\pecan-waffle.psm1:1232 char:18

  • ... (Get-ChildItem $mappedTempWorkDir $excludeStr -Recurse -Fi ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ReadError: (C:\Users\x...nternal-plugins:String) [Get-ChildItem], PathTooLongException
    • FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

MikaelPorttila avatar Apr 23 '16 07:04 MikaelPorttila

@MikaelPorttila ideally we would handle long files here. I have some ideas about how I could support long files, but adding the support may take a bit of time. Until then if you exclude those folders you shouldn't run into the long file issue. If you exclude a folder and still run into a long path issue please let me know.

If you need your template to drop files and they may have long files then let me know. You can do that, but it will be a bit of extra work on your part.

FYI last night I merged a bunch of changes from the dev branch. If you installed before that time I'd recommend updating.

sayedihashimi avatar Apr 23 '16 15:04 sayedihashimi

I installed pecan-waffle this morning (Swedish time) so I should be running your latest code. Excluding long paths fixed the issue and I was able to get a working copy of the template. :-) :+1:

Thanks for your help! Will you create another issue for the long path-support or should I keep this one open?

MikaelPorttila avatar Apr 23 '16 16:04 MikaelPorttila

@MikaelPorttila OK I've worked on long path support and I think I've covered all the touch points. The code is in the longpath branch. I got tied up with some actual work before being able to test it. Any chance you can try it?

sayedihashimi avatar Apr 28 '16 03:04 sayedihashimi

I was able to test it and it appears to work. I'm definitely having pathing issues of this solely on project names for complex projects so this is a pretty mandatory fix for us to use templates.

dotnetnate avatar Feb 09 '17 07:02 dotnetnate

@dotnetnate can u try from the longpath branch to see if that fixes your issues?

sayedihashimi avatar Feb 09 '17 16:02 sayedihashimi