Skip to content

Commit a451a50

Browse files
committed
Only overwrite spec file if we succeed in generating spec
1 parent 7ac977c commit a451a50

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/schema/generate-spec.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,15 @@ def create_markdown(spec):
237237
args = parser.parse_args()
238238
format = args.format
239239

240+
widgets_to_document = sorted(widgets.Widget._widget_types.items())
241+
spec = create_spec(widgets_to_document)
242+
240243
if args.output:
241244
args.output.parent.mkdir(exist_ok=True)
242245
output = open(args.output, mode='w', encoding='utf8')
243246
else:
244247
output = sys.stdout
245248

246-
widgets_to_document = sorted(widgets.Widget._widget_types.items())
247-
spec = create_spec(widgets_to_document)
248249
try:
249250
if format == 'json':
250251
try:

0 commit comments

Comments
 (0)