[FEATURE REQUEST] Create the output directory if it doesn't exist #891
Replies: 5 comments 3 replies
-
I'm going to convert this to a Discussion, since I'm curious to hear feedback from folks about what they think the most desirable behavior is here. |
Beta Was this translation helpful? Give feedback.
-
As per the above: what do people think of the above? I tend to think that it's better for tools to be cautious and error out in circumstances like these, but I don't have a super-strong opinion here. |
Beta Was this translation helpful? Give feedback.
-
Maybe it coulde be an option, like putting |
Beta Was this translation helpful? Give feedback.
-
I just want to show my personally agree on the feature being added, since it is very convenient for the users. I think making directory is a somehow of no harm in most circumstances, since users can always delete the directory along with the generated file after finding their mistake. Creating directory won't cause any permenant loss, so I think its advantage outperforms drawback for creating directory automatically. Just my personal opinion. |
Beta Was this translation helpful? Give feedback.
-
I also second this feature request. I don't see any major risks in not being cautious here, and nobody has posted any significant one in this discussion (perhaps I'm missing something?) As @Starrah, I also believe the advantage of this feature would be far more compelling than any possible drawback. On top of that, the disadvantage in not having this feature implemented explodes in situations where source files are organized in a more complex folder structure. The output directory tree of one of my projects looks like the following, and creating all the subdirectories manually when the output directory does not exists is somewhat painful, and also not very maintainable in automated build environments/CI pipelines:
|
Beta Was this translation helpful? Give feedback.
-
What's the Issue
Running the following command:
tectonic foo.tex --output bar
results in the error mentioned below because the directory
bar
doesn't exists yet.error: output directory "bar" does not exist
Possible Solution
A simple fix to the above workflow would be to simply create the input directory
bar
if it doesn't exist already. In doing so, it would relieve the user of any manual tasks no matter how trivial.It's a subtle feature but I'm pretty sure will be well-received by many users out there (unless I'm missing out on something obvious).
Beta Was this translation helpful? Give feedback.
All reactions