build: 👷 update build script for m1
This commit is contained in:
parent
6ad783f441
commit
f246a05b4d
2 changed files with 44 additions and 6 deletions
27
analyze_binary.py
Normal file
27
analyze_binary.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
from collections import defaultdict
|
||||
|
||||
# Initialize a dictionary to store the sizes of the folders
|
||||
folder_sizes = defaultdict(int)
|
||||
|
||||
# Parse the file
|
||||
with open(
|
||||
"archive_contents.txt", "r"
|
||||
) as f: # replace 'file.txt' with your file name
|
||||
for line in f:
|
||||
parts = line.split(",")
|
||||
if len(parts) < 2:
|
||||
continue
|
||||
size = int(parts[1].strip()) # get the size
|
||||
path = parts[-1].strip() # get the path
|
||||
|
||||
# Split the path into its components and accumulate the sizes for each folder
|
||||
path_parts = path.split("/")
|
||||
top_level = path_parts[0]
|
||||
folder_sizes[top_level] += size
|
||||
|
||||
# Sort the folders by size in descending order
|
||||
sorted_folders = sorted(folder_sizes.items(), key=lambda x: x[1], reverse=True)
|
||||
|
||||
# Print the sorted folders and their sizes
|
||||
for folder, size in sorted_folders:
|
||||
print(f"{folder}: {size}")
|
||||
23
buildm1.sh
23
buildm1.sh
|
|
@ -1,11 +1,22 @@
|
|||
|
||||
#!/bin/sh
|
||||
|
||||
# 1. Remove continuedev/.venv
|
||||
# 1. Remove unwanted stuff
|
||||
rm -rf build
|
||||
rm -rf env
|
||||
rm -rf dist
|
||||
rm -rf continuedev/.venv
|
||||
|
||||
# 2. Run pyinstaller run.m1.spec
|
||||
pyinstaller run.m1.spec
|
||||
# 2. Create a new virtual environment and activate it
|
||||
python3 -m venv env
|
||||
source env/bin/activate
|
||||
|
||||
# 3. Reinstall poetry deps
|
||||
cd continuedev && poetry install
|
||||
# 3. Install the required packages
|
||||
pip install -r continuedev/requirements.txt
|
||||
|
||||
pip install pyinstaller
|
||||
|
||||
# 4. Call PyInstaller from within the virtual environment
|
||||
env/bin/pyinstaller run.m1.spec
|
||||
|
||||
# 5. Deactivate the virtual environment
|
||||
deactivate
|
||||
Loading…
Add table
Reference in a new issue