This is an automated email from the ASF dual-hosted git repository.

tison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git


The following commit(s) were added to refs/heads/main by this push:
     new 6119fdab365 Allow long modified file list
6119fdab365 is described below

commit 6119fdab365b696f0f0727a44afce63b3c13e7ad
Author: tison <[email protected]>
AuthorDate: Fri Jan 13 14:10:36 2023 +0800

    Allow long modified file list
    
    Signed-off-by: tison <[email protected]>
---
 tools/pytools/lib/execute/site_builder.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tools/pytools/lib/execute/site_builder.py 
b/tools/pytools/lib/execute/site_builder.py
index d2ecf1638ae..9296b53f3ef 100644
--- a/tools/pytools/lib/execute/site_builder.py
+++ b/tools/pytools/lib/execute/site_builder.py
@@ -16,17 +16,20 @@
 # under the License.
 
 import shutil
+import tempfile
 from pathlib import Path
 
-from command import find_command, run_pipe, run
+from command import find_command, run
 from constant import site_path
 
 
 def execute(asf_site: Path):
     # 1. Get modified files
     git = find_command('git', msg="git is required")
-    modified_files = run_pipe(git, 'diff', '--name-only', 'HEAD~1', 'HEAD', 
cwd=site_path()).read().strip()
-    modified_files = modified_files.split('\n')
+    with tempfile.TemporaryFile('w+') as f:
+        run(git, 'diff', '--name-only', 'HEAD~1', 'HEAD', stdout=f, 
cwd=site_path())
+        f.seek(0)
+        modified_files = f.read().splitlines()
     for file in modified_files:
         print(f"{file} was modified")
 

Reply via email to