HeyPuter / phoenix

🔥 Puter's pure-javascript shell
https://puter.com/app/terminal
GNU Affero General Public License v3.0
87 stars 15 forks source link

Resolve ~ in paths as the home directory #38

Closed AtkinsSJ closed 4 months ago

AtkinsSJ commented 4 months ago

We already had code for this in ls, but it was buggy: removing the first character of ~/foo produces /foo, which then always resolves to /foo regardless of what parent path you give it.

This fixes that by prepending a ., makes this a function in a new utils/path.js file, and then uses that in every location I could find that tries to resolve relative paths.

Fixes #34.