playcanvas / playcanvas-sync

Real-time synchronization of files between PlayCanvas and your local machine
https://playcanvas.com/
MIT License
75 stars 19 forks source link

Fix getAssetId for remotePath === "." #40

Closed querielo closed 2 years ago

querielo commented 2 years ago

For the "." path, ID is suggested to be equal to null (you can see it in the parent field of assets in the root directory). But right now getAssetId throws an exception here when you try to rename an asset into the root directory but parentId for "." has to be null

zachpeterpaul commented 2 years ago

Thank you for pointing out this issue, I think it's better to consistently represent the root dir as an empty string at an early stage, and I merged a pr for that https://github.com/playcanvas/playcanvas-sync/pull/42. Closing this pr.