gregorio-project / gregorio

The Gregorio Project
http://gregorio-project.github.io
Other
164 stars 43 forks source link

Option to create output directory when it doesn't exist? #1542

Open rpspringuel opened 3 years ago

rpspringuel commented 3 years ago

Does it make sense to add an option to the executable that would allow it to create the directory associated with the -o option when it is given? The other option would be for the Lua code to check for the directory's existence and create it if it doesn't find it.

henryso commented 3 years ago

What is the use case?

rpspringuel commented 3 years ago

One use case is in my PR (which uses Lua to create the directory, rather than the executable).

Another would presumably be whenever the uses wants to specify the full path to the output file (say in a script that works on multiple files). The option would save the step of making sure the output directory exists.

✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️ Fr. Samuel, OSB (R. Padraic Springuel) St. Anselm’s Abbey 4501 South Dakota Ave, NE Washington, DC, 20017 202-269-2300 (c) 202-853-7036

PAX ☧ ΧΡΙΣΤΟΣ

On May 23, 2021, at 10:16 PM, Henry So @.***> wrote:

 What is the use case?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

henryso commented 3 years ago

I'm resistant to this idea. Are there any other cases of TeX components creating directories and stuff outside their purview? It kind of feels like a protection violation to allow the user to use a write18-exempted program to create random directories.

rpspringuel commented 3 years ago

Not so much random as asked for both by specifying the output path and invoking the option that says it’s okay to create directories. However, I can see the point about it potentially being a security issue.

Sent with GitHawk