http://coldfusion.com logo
#lucee
Title
# lucee
b

bdw429s

03/17/2022, 8:25 PM
@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

zackster

03/17/2022, 8:27 PM
Yeah, needs some test cases. On my list for tomorrow
b

bdw429s

03/17/2022, 8:27 PM
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

zackster

03/17/2022, 8:42 PM
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
4 Views