File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,8 @@ def codegen() -> str:
7373if __name__ == "__main__" :
7474 print ("running codegen" )
7575 palette_path = Path .cwd () / "catppuccin" / "palette.py"
76- palette_path .write_text (codegen (), newline = "\n " )
76+ with palette_path .open ("w" , newline = "\n " ) as f :
77+ f .write (codegen ())
7778 print ("formatting with ruff" )
7879 ruff_format = f"ruff format { palette_path } "
7980 subprocess .run (ruff_format .split (), check = True , stdout = subprocess .DEVNULL )
@@ -97,7 +98,9 @@ def codegen() -> str:
9798 f"<{ color } >" ,
9899 palette ["colors" ][color ]["hex" ].replace ("#" , "" ),
99100 )
100- (CATPPUCCIN_STYLE_DIRECTORY / f"{ key } .mplstyle" ).write_text (text , newline = "\n " )
101+ style_path = CATPPUCCIN_STYLE_DIRECTORY / f"{ key } .mplstyle"
102+ with style_path .open ("w" , newline = "\n " ) as f :
103+ f .write (text )
101104 print ("matplotlib styles generation complete" )
102105
103106 # Generate matplotlib assets for the docs
You can’t perform that action at this time.
0 commit comments