-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build_library.sh
executable file
·81 lines (62 loc) · 2.21 KB
/
build_library.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/zsh
# Concatenate all Lua files in the current directory into one except for builtins.
library_file="library.lua"
dev_library_file="library-dev.lua"
# Delete the existing library files if they exist
[ -f "$library_file" ] && rm "$library_file"
[ -f "$dev_library_file" ] && rm "$dev_library_file"
# Add the top content to library.lua
echo "-- SCROLL TO BOTTOM ----------------------------------------------------\n" > "$library_file"
# Concatenate the Lua files into library.lua using find
find . -name '*.lua' -not -name "$library_file" -not -name 'builtins.lua' -not -name 'temp_library.lua' -exec cat {} + >> "$library_file"
echo "\n" >> "$library_file" # Add a newline at the end
# Add the bottom content to library.lua
cat << EOF >> "$library_file"
-- AUDULUS-CANVAS LIBRARY ----------------------------------------------
-- Version: 0.0.3-alpha
-- Updated: 2024.01.29
-- URL: https://github.com/markalanboyd/Audulus-Canvas
----- Instructions -----
-- 1. Create 'Time' input (case-sensitive)
-- 2. Attach Timer node to the 'Time' input
-- 3. Select 'Save Data' at the bottom of the inspector panel
-- 4. Set a custom W(idth) and H(eight) in the inspector panel
-- 5. Write your code in the CODE block below
origin = Origin.new({
direction = "c",
type = "crosshair",
width = 4,
color = theme.text
})
root = Layer.new({name = "ROOT"})
bg = Overlay.new(origin, {name = "Background", color=Color.new(theme.modules)})
-- CODE ----------------------------------------------------------------
-- PRINT CONSOLE -------------------------------------------------------
layer_tree = {
{name = "BACKGROUND",
z_index = -math.huge,
contents = {background}},
{name = "FOREGROUND",
z_index = math.huge,
contents = {origin}},
{name = "LAYER1",
z_index = 0,
contents = {},
sublayers {
{name = "NESTED LAYER",
z_index = 0,
contents = {},
sublayers = {} }
}
{name = "LAYER2",
z_index = 0,
contents = {},
sublayers = {} },
}
root(layer_tree):draw()
origin:reset()
print(root)
print_all()
EOF
# Create development version of the library file (library-dev.lua)
awk '/-- CODE ----------------------------------------------------------------/{print; exit} {print}' "$library_file" > "$dev_library_file"