mirror of
https://github.com/ful1e5/apple_cursor.git
synced 2025-05-15 07:34:44 -04:00
✨ main method added
This commit is contained in:
parent
f4963e500a
commit
85032a0e9e
1 changed files with 13 additions and 30 deletions
41
build.py
41
build.py
|
@ -1,37 +1,20 @@
|
||||||
import json
|
import json
|
||||||
import shutil
|
|
||||||
import tempfile
|
|
||||||
|
|
||||||
from os import path, listdir
|
|
||||||
from clickgen import build_cursor_theme
|
from clickgen import build_cursor_theme
|
||||||
|
|
||||||
# Config
|
from config import name, sizes, delay, bitmaps_dir, temp_folder
|
||||||
name = "MacOS Big Sur"
|
from helper import cleanup, init_build
|
||||||
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")
|
|
||||||
|
|
||||||
|
|
||||||
|
def build() -> None:
|
||||||
|
init_build()
|
||||||
# Building Cursor Theme
|
# Building Cursor Theme
|
||||||
with open('./hotspots.json', 'r') as hotspot_file:
|
with open('./hotspots.json', 'r') as hotspot_file:
|
||||||
config = json.loads(hotspot_file.read())
|
hotspots = json.loads(hotspot_file.read())
|
||||||
build_cursor_theme(name, image_dir="./bitmaps",
|
build_cursor_theme(name, image_dir=bitmaps_dir,
|
||||||
cursor_sizes=sizes, out_path=temp_folder, archive=False, delay=30)
|
cursor_sizes=sizes, out_path=temp_folder, hotspots=hotspots, archive=False, delay=delay)
|
||||||
|
# helper method
|
||||||
|
cleanup()
|
||||||
|
|
||||||
# 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
|
if __name__ == "__main__":
|
||||||
# - .tar archive for X11
|
build()
|
||||||
# - .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