File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323
2424 - name : Install build tools (Linux only)
2525 if : runner.os == 'Linux'
26- run : sudo apt-get update && sudo apt-get install -y build-essential cmake
26+ run : sudo apt-get update && sudo apt-get install -y build-essential cmake pkg-config ninja nasm
27+
28+ - name : Install build tools (macOS only)
29+ if : runner.os == 'macOS'
30+ run : brew install cmake pkg-config nasm ninja
2731
2832 - name : Install build dependencies
2933 run : |
Original file line number Diff line number Diff line change @@ -45,7 +45,19 @@ def extract_zip(zip_path, dest_dir):
4545 os .makedirs (os .path .dirname (target_path ), exist_ok = True )
4646 with open (target_path , "wb" ) as f :
4747 f .write (zip_ref .read (member ))
48- print (f"Extracted { zip_path } to { dest_dir } " )
48+ extracted_dir = os .path .join (dest_dir , top_level )
49+ if os .path .isdir (extracted_dir ):
50+ for item in os .listdir (extracted_dir ):
51+ src = os .path .join (extracted_dir , item )
52+ dst = os .path .join (dest_dir , item )
53+ if os .path .exists (dst ):
54+ if os .path .isdir (dst ):
55+ shutil .rmtree (dst )
56+ else :
57+ os .remove (dst )
58+ shutil .move (src , dst )
59+ shutil .rmtree (extracted_dir )
60+ print (f"Extracted and flattened { zip_path } to { dest_dir } " )
4961
5062def extract_tar (tar_path , dest_dir ):
5163 with tarfile .open (tar_path , "r:gz" ) as tar_ref :
You can’t perform that action at this time.
0 commit comments