-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·65 lines (47 loc) · 1.71 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·65 lines (47 loc) · 1.71 KB
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
#!/bin/bash
# Set up Motion Canvas with workspaces and pre-commit hooks
set -ex # exit on error, print commands
cd "$(dirname "$0")"
echo "Setting up Motion Canvas with workspaces..."
# Clone motion-canvas repository
if [ ! -d "motion-canvas" ]; then
git clone https://github.com/polylog-cs/motion-canvas.git motion-canvas
fi
cd motion-canvas
git pull
# Wipe stale node_modules from previous installs
rm -rf node_modules ../node_modules
# Install dependencies in motion-canvas
npm install --save-dev rollup
# Fix TypeScript configuration for core package (idempotent — only patches if
# the lib line isn't already present, so re-runs don't accumulate duplicates).
if ! grep -q '"lib": \["es2020"' packages/core/tsconfig.json; then
SED_INPLACE=(-i)
[[ "$OSTYPE" == "darwin"* ]] && SED_INPLACE=(-i '')
sed "${SED_INPLACE[@]}" 's/"target": "es2020",/"target": "es2020",\n "lib": ["es2020", "dom", "es2022.intl"],/' packages/core/tsconfig.json
fi
# Build all packages
npx lerna run build
# Go back to main project
cd ..
# Install project dependencies using workspaces
npm install
echo "Motion Canvas setup with workspaces complete!"
# Set up Python virtual environment and pre-commit hooks
echo "Setting up pre-commit hooks..."
# Create virtual environment if it doesn't exist
if [ ! -d ".venv" ]; then
python3 -m venv .venv
fi
# Activate virtual environment
source .venv/bin/activate
# Upgrade pip
pip install --upgrade pip
# Install pre-commit
pip install pre-commit
# Install pre-commit hooks
pre-commit install
echo "Pre-commit hooks installed successfully!"
echo ""
echo "Setup complete! You can now run 'npm run start' to start the preview server."
echo "Pre-commit hooks will automatically check your code when you commit."