mirror of
https://github.com/denoland/deno.git
synced 2024-12-01 16:51:13 -05:00
Chunk prettier invocation (#6129)
This avoids failures due to exceeding the maximum command line length. Fixes: #5017
This commit is contained in:
parent
ee192b0758
commit
2093ee55d4
1 changed files with 8 additions and 5 deletions
|
@ -58,11 +58,14 @@ def prettier():
|
||||||
"bin-prettier.js")
|
"bin-prettier.js")
|
||||||
source_files = get_sources(root_path, ["*.js", "*.json", "*.ts", "*.md"])
|
source_files = get_sources(root_path, ["*.js", "*.json", "*.ts", "*.md"])
|
||||||
if source_files:
|
if source_files:
|
||||||
print_command("prettier", source_files)
|
max_command_length = 24000
|
||||||
run(["node", script, "--write", "--loglevel=error", "--"] +
|
while len(source_files) > 0:
|
||||||
source_files,
|
command = ["node", script, "--write", "--loglevel=error", "--"]
|
||||||
shell=False,
|
while len(source_files) > 0:
|
||||||
quiet=True)
|
command.append(source_files.pop())
|
||||||
|
if len(" ".join(command)) > max_command_length:
|
||||||
|
run(command, shell=False, quiet=True)
|
||||||
|
break
|
||||||
|
|
||||||
|
|
||||||
def yapf():
|
def yapf():
|
||||||
|
|
Loading…
Reference in a new issue