terrastruct / d2

D2 is a modern diagram scripting language that turns text to diagrams.
https://d2lang.com
Mozilla Public License 2.0
16.82k stars 421 forks source link

Help Footgun #774

Open chrisortman opened 1 year ago

chrisortman commented 1 year ago

This was totally my fault. I thought to myself I wonder if I can pass multiple files on the command line to have them both be watched. So I ran d2 --watch file1.d2 file2.d2

I can say, it does not watch both files, but it does do what it says it will do if I RTFM which is write the output of rendering file1.d2 two file2.d2 :(

Sadly, I had a bunch of edits I had done.

This seems like an easy mistake? potentially aborting if the second file argument ends with .d2 ? Or requiring the -o flag for a file that exists?

Maybe nothing because it happened one time to this one idiot.

Cheers, really prefer this tool to mermaid so keep up the good work

bo-ku-ra commented 1 year ago

i think so too. d2 would need to use the '-f' or '-o' option to force overwriting, except for .svg and .png files.

alixander commented 1 year ago

tbh, i'm not sure what the good unixy thing is to do here. @nhooyr any thoughts?

nhooyr commented 1 year ago

Yea darn this is a big problem, definitely need to put output behind a flag. I now understand why so many tools have an -o flag lol.