mirror of
https://github.com/ful1e5/apple_cursor.git
synced 2025-05-13 22:54: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 json
|
||||||
import shutil
|
import shutil
|
||||||
|
import tempfile
|
||||||
|
|
||||||
|
from os import path, listdir
|
||||||
from clickgen import build_cursor_theme
|
from clickgen import build_cursor_theme
|
||||||
|
|
||||||
|
# Config
|
||||||
|
name = "MacOS Big Sur"
|
||||||
sizes = [24, 28, 32, 40, 48, 56, 65, 72, 80, 88, 96]
|
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
|
# 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())
|
config = json.loads(hotspot_file.read())
|
||||||
build_cursor_theme(name="macOS Big Sur", image_dir="./bitmaps",
|
build_cursor_theme(name, image_dir="./bitmaps",
|
||||||
cursor_sizes=sizes, out_path="out", archive=False, delay=30)
|
cursor_sizes=sizes, out_path=temp_folder, archive=False, delay=30)
|
||||||
|
|
||||||
# Rename directory & cleanup
|
# Rename directory
|
||||||
shutil.move("./out/macOS Big Sur/x11", "./out/macOSBigSur")
|
shutil.move(path.join(temp_folder, name, "x11"), x11_out_dir)
|
||||||
shutil.move("./out/macOS Big Sur/win", "./out/macOSBigSur_Windows")
|
shutil.move(path.join(temp_folder, name, "win"), win_out_dir)
|
||||||
shutil.rmtree("./out/macOS Big Sur")
|
|
||||||
|
# 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