Remove ENV_PATH on Black action completion (#3759)

This commit is contained in:
Christian Proud 2023-08-09 02:12:05 +08:00 committed by GitHub
parent 77f19944f6
commit c36e468794
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -50,6 +50,8 @@
[official pre-commit mirror](https://github.com/psf/black-pre-commit-mirror). Swapping
`https://github.com/psf/black` to `https://github.com/psf/black-pre-commit-mirror` in
your `.pre-commit-config.yaml` will make Black about 2x faster (#3828)
- The `.black.env` folder specified by `ENV_PATH` will now be removed on the completion
of the GitHub Action. (#3759)
### Documentation

View File

@ -1,5 +1,6 @@
import os
import shlex
import shutil
import sys
from pathlib import Path
from subprocess import PIPE, STDOUT, run
@ -73,5 +74,6 @@
stderr=STDOUT,
encoding="utf-8",
)
shutil.rmtree(ENV_PATH, ignore_errors=True)
print(proc.stdout)
sys.exit(proc.returncode)