scour-project / scour

Scour - An SVG Optimizer / Cleaner
Apache License 2.0
757 stars 61 forks source link

Overwrite svg file if input file is output #274

Closed gistrec closed 3 years ago

gistrec commented 3 years ago

Hi, if input and output are the same file, there will be an error Input filename is the same as output filename. But I think, that this is valid case of usage.

JoKalliauer commented 3 years ago

Imho duplicate of https://github.com/scour-project/scour/issues/129

Be aware the Input-file should be backuped according to @Ede123 https://github.com/scour-project/scour/issues/33#issuecomment-167798462:

What we could think about is overwriting the input file if no output file name is specified but this might result in really ugly scenarios of data loss, so maybe we should just stick to the current behavior and require the user to provide a valid output file name.

and by @Eitot in https://github.com/scour-project/scour/issues/33#issuecomment-167922813

But it would be better than overwriting the input file, which I cannot recommend, based on my own experience with this program and others.

Ede123 commented 3 years ago

Duplicate of #129.