NansPellicari / UE4-TPL-CppWithTestEnv

Launch your tests and code coverage in UE4 project with just 1 commandline + get nice reports!
Apache License 2.0
25 stars 7 forks source link

Get-ChildItem : Cannot find path 'C:\Users\tmend\Code\S' because it does not exist. #5

Open timendez opened 3 years ago

timendez commented 3 years ago

Hi, I'm trying to get this set up and am on the ChangeProjectName.bat step and am running into this issue:

$ ./ChangeProjectName.bat -f 'TestRunnerTest'
Clean project dirs
Rename all project files and dir
force? True
1- Will changes "MyProject" to "TestRunnerTest" files and directory names.
2- Will replaces "MyProject" occurences to "TestRunnerTest" in all files recursively in ./Source/ ./Config/ dir.
Get-ChildItem : Cannot find path 'C:\Users\tmend\Code\S' because it does not exist.
At C:\Users\tmend\Code\TestRunnerTest\Scripts\RenameProject.ps1:44 char:5
+     Get-ChildItem -File -Path "./Source/","./Config/" -Recurse -Exclu ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\tmend\Code\S:String) [Get-ChildItem], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

Get-ChildItem : Cannot find path 'C:\Users\tmend\Code\C' because it does not exist.
At C:\Users\tmend\Code\TestRunnerTest\Scripts\RenameProject.ps1:44 char:5
+     Get-ChildItem -File -Path "./Source/","./Config/" -Recurse -Exclu ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\tmend\Code\C:String) [Get-ChildItem], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

Get-ChildItem : Cannot find path 'C:\Users\tmend\Code\S' because it does not exist.
At C:\Users\tmend\Code\TestRunnerTest\Scripts\RenameProject.ps1:49 char:5
+     Get-ChildItem -File -Path "./Source/","./Config/" -Recurse -Exclu ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\tmend\Code\S:String) [Get-ChildItem], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

Get-ChildItem : Cannot find path 'C:\Users\tmend\Code\C' because it does not exist.
At C:\Users\tmend\Code\TestRunnerTest\Scripts\RenameProject.ps1:49 char:5
+     Get-ChildItem -File -Path "./Source/","./Config/" -Recurse -Exclu ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\tmend\Code\C:String) [Get-ChildItem], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

3- Will replaces "MyProject" occurences to "TestRunnerTest" in all files at the root dir & TestsReports/ (not recursive).
Get-ChildItem : Cannot find path 'C:\Users\tmend\Code\TestsReports\' because it does not exist.
At C:\Users\tmend\Code\TestRunnerTest\Scripts\RenameProject.ps1:64 char:5
+     Get-ChildItem -File -Path ".","./TestsReports/" | ForEach-Object  ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\tmend\Code\TestsReports\:String) [Get-ChildItem], ItemNotFound
   Exception
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

Project does not exists here: "C:\Users\tmend\Code\TestRunnerTest\MyProject.uproject"

Let me know if there's any additional information I can provide, thanks!

NansPellicari commented 3 years ago

Oh sorry Timendez, I haven't read my emails for days! I am on it! Just to be sure, I assume your working directory is C:\Users\tmend\Code\TestRunnerTest and this is where you clone the repository ?

After a quick look at error messages Cannot find path 'C:\Users\tmend\Code\S', it seems that the powershell's script does not execute in the right directory + it messes with Source & Config folder: it just reads their first letters...

NansPellicari commented 3 years ago

Sorry I can't reproduce the bug on my side, can you add these 2 lines on the file ChangeProjectName.bat between lines 49 and 50 and give me the results?:

echo "& '%PROJ_DIR%\Scripts\RenameProject.ps1' '%p1%' '%p2%' %p3%"
exit

It should look like this: image