<https://twitter.com/zackster/status/1504552948344...
# lucee
b
@zackster That's pretty cool and I didn't know about it. However, it doesn't seem to work well. If there is no mapping, it's supposed to return the original path, but
Copy code
❯ #contractpath C:/windows/system32
../null
it's like it just does weird stuff there
Even on linux-- this is from trycf.com
Copy code
echo( contractpath( "/opt/" ) )
outputs
Copy code
../../../opt
Neither of those are matching a mapping at all
z
Yeah, needs some test cases. On my list for tomorrow
b
Cool function though
I have a similar one in CommandBox that also auto-creates the CF mappings on the fly so it always returns a relative path regardless.
I could use this in there to help find the existing mappings.
z
ok quick initial test case added, feel free to add tests https://github.com/lucee/Lucee/commit/003a48c142a1796eb035bab905d786adab3f7f37 I'm off to see some live music