]>
git.madduck.net Git - etc/vim.git/blobdiff - action/main.py
madduck's git repository
Every one of the projects in this repository is available at the canonical
URL git://git.madduck.net/madduck/pub/<projectpath> — see
each project's metadata for the exact URL.
All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@ git. madduck. net .
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
SSH access, as well as push access can be individually
arranged .
If you use my repositories frequently, consider adding the following
snippet to ~/.gitconfig and using the third clone URL listed for each
project:
[url "git://git.madduck.net/madduck/"]
insteadOf = madduck:
import sys
from pathlib import Path
from subprocess import PIPE, STDOUT, run
import sys
from pathlib import Path
from subprocess import PIPE, STDOUT, run
describe_name = line[len("describe-name: ") :].rstrip()
break
if not describe_name:
describe_name = line[len("describe-name: ") :].rstrip()
break
if not describe_name:
- print("::error::Failed to detect action version.", flush=True)
+ print("::error::Failed to detect action version.", file=sys.stderr, f lush=True)
sys.exit(1)
# expected format is one of:
# - 23.1.0
sys.exit(1)
# expected format is one of:
# - 23.1.0
)
if pip_proc.returncode:
print(pip_proc.stdout)
)
if pip_proc.returncode:
print(pip_proc.stdout)
- print("::error::Failed to install Black.", flush=True)
+ print("::error::Failed to install Black.", file=sys.stderr, f lush=True)
sys.exit(pip_proc.returncode)
base_cmd = [str(ENV_BIN / "black")]
if BLACK_ARGS:
# TODO: remove after a while since this is deprecated in favour of SRC + OPTIONS.
sys.exit(pip_proc.returncode)
base_cmd = [str(ENV_BIN / "black")]
if BLACK_ARGS:
# TODO: remove after a while since this is deprecated in favour of SRC + OPTIONS.
- proc = run([*base_cmd, *shlex.split(BLACK_ARGS)])
+ proc = run(
+ [*base_cmd, *shlex.split(BLACK_ARGS)],
+ stdout=PIPE,
+ stderr=STDOUT,
+ encoding="utf-8",
+ )
- proc = run([*base_cmd, *shlex.split(OPTIONS), *shlex.split(SRC)])
-
+ proc = run(
+ [*base_cmd, *shlex.split(OPTIONS), *shlex.split(SRC)],
+ stdout=PIPE,
+ stderr=STDOUT,
+ encoding="utf-8",
+ )
+shutil.rmtree(ENV_PATH, ignore_errors=True)
+print(proc.stdout)
sys.exit(proc.returncode)
sys.exit(proc.returncode)