mirror of
https://github.com/ful1e5/apple_cursor.git
synced 2025-05-13 14:44:45 -04:00
💖 Clean build process
This commit is contained in:
parent
9fdc07044d
commit
b111b88eb0
1 changed files with 26 additions and 6 deletions
32
build.py
32
build.py
|
@ -1,17 +1,37 @@
|
|||
import json
|
||||
import shutil
|
||||
import tempfile
|
||||
|
||||
from os import path, listdir
|
||||
from clickgen import build_cursor_theme
|
||||
|
||||
# Config
|
||||
name = "MacOS Big Sur"
|
||||
sizes = [24, 28, 32, 40, 48, 56, 65, 72, 80, 88, 96]
|
||||
temp_folder = tempfile.mkdtemp()
|
||||
package_dir = "./packages"
|
||||
x11_out_dir = path.join(package_dir, "macOSBigSur")
|
||||
win_out_dir = path.join(package_dir, "macOSBigSur_Windows")
|
||||
|
||||
# Building Cursor Theme
|
||||
with open('./hotspots.json', 'r') as hotspot_file:
|
||||
config = json.loads(hotspot_file.read())
|
||||
build_cursor_theme(name="macOS Big Sur", image_dir="./bitmaps",
|
||||
cursor_sizes=sizes, out_path="out", archive=False, delay=30)
|
||||
build_cursor_theme(name, image_dir="./bitmaps",
|
||||
cursor_sizes=sizes, out_path=temp_folder, archive=False, delay=30)
|
||||
|
||||
# Rename directory & cleanup
|
||||
shutil.move("./out/macOS Big Sur/x11", "./out/macOSBigSur")
|
||||
shutil.move("./out/macOS Big Sur/win", "./out/macOSBigSur_Windows")
|
||||
shutil.rmtree("./out/macOS Big Sur")
|
||||
# Rename directory
|
||||
shutil.move(path.join(temp_folder, name, "x11"), x11_out_dir)
|
||||
shutil.move(path.join(temp_folder, name, "win"), win_out_dir)
|
||||
|
||||
# Packaging
|
||||
# - .tar archive for X11
|
||||
# - .zip archive for Windows
|
||||
shutil.make_archive(x11_out_dir, "tar", x11_out_dir)
|
||||
shutil.make_archive(win_out_dir, "zip", win_out_dir)
|
||||
|
||||
# Clenaup
|
||||
shutil.rmtree(temp_folder)
|
||||
for f in listdir(package_dir):
|
||||
f_path = path.join(package_dir, f)
|
||||
if path.isdir(f_path):
|
||||
shutil.rmtree(f_path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue