tom-seddon / beeblink

A file storage system for the BBC Micro
GNU General Public License v3.0
16 stars 2 forks source link

Correctly handle ~-expansion #127

Open tom-seddon opened 1 year ago

tom-seddon commented 1 year ago

Shouldn't the shell do this for you? But clearly it doesn't in beeblink's case. I'm sure this used to work. Or maybe it never has, and I somehow never noticed/never got round to adding an issue.

See https://github.com/nodejs/node/issues/684 - looks like Node won't change this.

There's a helper function that's been there for ages but never used, so maybe I did notice this at some point: https://github.com/tom-seddon/beeblink/blob/fc0cc9c2cd7d112231d01decb06932fbbe418fe8/server/utils.ts#L447 - this would do as a first pass.

https://www.npmjs.com/package/untildify? Looks like it might not handle the ~USER syntax, so little current advantage to using this. Does this even matter?