ion-cli icon indicating copy to clipboard operation
ion-cli copied to clipboard

`ion dump` cannot format a file inplace

Open progwriter opened this issue 2 years ago • 0 comments

I have a simple use case of formatting ion files in-place. I tried this via

ion dump --format pretty foo.ion -o foo.ion

which resulted in empty files.

It appears that this code here: https://github.com/amazon-ion/ion-cli/blob/master/src/bin/ion/commands/dump.rs#L54-L68 opens the file for writing before reading the file making a simple in-place format impossible.

progwriter avatar Apr 17 '23 19:04 progwriter