You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm terribly sorry since I don't know Rust enough to contribute by myself and that's why this is an issue and not a PR. If I'll spot the parser I'll begin to do some test.
The text was updated successfully, but these errors were encountered:
I definitely think this could be useful. Just already has some built-in functions, so it would be easy to create new ones that performed these operations:
foo := "A/B/C.D"
echo {{without_extension(foo)}} // A/B/C (Removes extension)
echo {{file_name(foo)}} // C.D (Removes the path)
echo {{directory(foo)}} // A/B (Keeps the path only)
echo {{file_stem(foo)}} // C (Removes path and extension)
Rust has a bunch of path operations in the standard library which could be used in the implementation, so it wouldn't be necessary to write them from scratch.
I think that a feature like GNU parallel's replacement strings would be handy.
I was wondering something like:
foo := "A/B/C.D" echo {{foo.}} // A/B/C (Removes extension) echo {{foo/}} // C.D (Removes the path) echo {{foo//}} // A/B (Keeps the path only) echo {{foo/.}} // C (Removes path and extension)
What do you think @casey?
I'm terribly sorry since I don't know Rust enough to contribute by myself and that's why this is an issue and not a PR. If I'll spot the parser I'll begin to do some test.
The text was updated successfully, but these errors were encountered: