bicep icon indicating copy to clipboard operation
bicep copied to clipboard

Prompt user to overwrite json file if it already exists when building bicep file

Open ucheNkadiCode opened this issue 3 years ago • 2 comments

When a user tries to build a file named "test3.bicep", if they happen to have a corresponding JSON that was not compiled from Bicep they receive this message image

In this case, I would love us to instead give a message more similar to image

And give them the ability to overwrite this file in place of a Bicep build. We should provide this option regardless of if this JSON file was compiled from Bicep or not. Simple naming conflict is what we should check for.

ucheNkadiCode avatar Jan 25 '22 22:01 ucheNkadiCode

I agree. I ran into this issue, and it was somewhat workflow-breaking to have to manually delete the file.

majastrz avatar Jan 26 '22 02:01 majastrz

Blocked by https://github.com/Azure/bicep/issues/8514

StephenWeatherford avatar Sep 29 '22 20:09 StephenWeatherford

Suggest: won't fix.

I think the current behavior is reasonable. We will automatically replace the current JSON file if it was previously built by Bicep. If it wasn't produced by Bicep, the odds are higher that it was a mistake. I don't think we should spend time worrying about automatically a delete if the file in this case. (Low bang for buck.)

StephenWeatherford avatar Feb 10 '23 17:02 StephenWeatherford