cortesi / modd

A flexible developer tool that runs processes and responds to filesystem changes
MIT License
2.79k stars 130 forks source link

escaping '@'? #35

Closed maddyblue closed 6 years ago

maddyblue commented 7 years ago

I'm trying to use modd with curl's "read a file" option. curl will read a file from disk when its argument starts with @. This conflicts with modd's conf, though, which thinks @ is for its own configuration. I wasn't able to find an escape option to prevent modd from interpreting the @. Is there a way to do this?

cortesi commented 7 years ago

Hi there. At the moment, I'm afraid this is a simple regex replacement with no escaping. We certainly should make this safer, though. One option is to introduce escaping. Another is to punt again and make the replacement indicator more elaborate and less likely to clash ("{{variable}}"?).

Patches gladly accepted. :) Otherwise, I'll put this on the todo list for the next release.

ksonj commented 7 years ago

Does this mean it is currently impossible to start a daemon with something like

{
     daemon: service --database-uri=mysql://user@localhost ...
 }

because @localhost is interpreted as a variable?

ksonj commented 7 years ago

Storing the URI as a variable and then using that variable is my current workaround

@database = mysql://user@localhost/db

{
     daemon: service --database=@database ..
}