Code-Stage / Package2Folder

Allows to import Unity packages into specified folder to avoid your project's root bloating.
Mozilla Public License 2.0
62 stars 15 forks source link

"es" is appended to selected import folder with package-based exports #2

Closed GobbleSlop closed 3 years ago

GobbleSlop commented 3 years ago

Hi, thanks for this asset. When exporting packages using the -exportPackage command line argument to the unity editor, and using that to export from a directory in the ProjectRoot/Packages/SomePackage folder, upon import Package2Folder believes the selected "import here" directory should have an extra -es on the end.

I realize exporting from the Packages folder is probably out of band and maybe making a malformed .unityPackage. And its pretty easy to just move the contents after import. But it can lead to some confusion as the contents won't show up when importing to the root Assets folder!

I'm including one such .unitypackage AUTOEXPORT.zip

Here also are some repro steps Import the package authoring library by going to package manager, click + sign, Add package from Git URL, com.unity.upm.develop Create a package named Test Quit out of Unity
Open the Unity Hub Click the three dots to the right of the test project Click Advanced Project Settings Add a command line argument to export a directory inside the package you just created In my case I used -exportPackage packages/com.vestigial.test/runtime AUTOEXPORT.unityPackage Click "Done"

Reopen the project, the AUTOEXPORT package gets created at the project root Remove the Test package (to allow the files to be imported, and not "nothing new to import") Use Package2Folder "Import here" to import the AutoExport package to the ProjectRoot/Assets folder Notice the contents are actually imported to ProjectRoot/Assetses folder which is not visible to the unity assets system! This also applies to importing to folders like Assets/Middle, it will import to Assets/Middlees

DmitriyYukhanov commented 3 years ago

Hey @vestigialdev , thank you for reporting this, will take a look, seems to be on Unity side (since I'm just using their APIs via reflection) but I'll double-check!

GobbleSlop commented 3 years ago

I looked around, I think the problem is on the highlighted line, theres a reasonable expectation that its from somewhere in Assets, so its trimming off the first six characters, but since Packages is a bit longer, the "es" is leftover, etc.

Untitled

DmitriyYukhanov commented 3 years ago

Hey @vestigialdev thank you for the additional details, please try latest 1.0.4 version with a tiny fix for that silly way I chose to remove "Assets" from the path =)

DmitriyYukhanov commented 3 years ago

Closing this for now as fixed, please let me know if it's still reproduces.

GobbleSlop commented 3 years ago

Thank you, seems to work after a little test