forked from microsoft/pxt-neopixel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·75 lines (64 loc) · 1.83 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·75 lines (64 loc) · 1.83 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
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
# MakeCode NeoPixel Extension Setup Script
# Run this script after restarting your machine to restore the development environment
set -e # Exit on any error
echo "🚀 Setting up MakeCode NeoPixel Extension development environment..."
echo ""
# Check if we're in the right directory
if [ ! -f "pxt.json" ]; then
echo "❌ Error: pxt.json not found. Please run this script from the project root directory."
exit 1
fi
echo "📁 Current directory: $(pwd)"
echo ""
# Step 1: Set MakeCode target
echo "🎯 Step 1: Setting MakeCode target to micro:bit..."
pxt target microbit
if [ $? -eq 0 ]; then
echo "✅ MakeCode target set successfully"
else
echo "❌ Failed to set MakeCode target"
exit 1
fi
echo ""
# Step 2: Install dependencies
echo "📦 Step 2: Installing project dependencies..."
pxt install
if [ $? -eq 0 ]; then
echo "✅ Dependencies installed successfully"
else
echo "❌ Failed to install dependencies"
exit 1
fi
echo ""
# Step 3: Test build
echo "🔨 Step 3: Testing build process..."
pxt build
if [ $? -eq 0 ]; then
echo "✅ Build completed successfully"
else
echo "❌ Build failed"
exit 1
fi
echo ""
# Step 4: Check TypeScript types
echo "🔍 Step 4: Checking TypeScript configuration..."
if [ -f "types/makecode.d.ts" ]; then
echo "✅ TypeScript definitions found"
else
echo "⚠️ Warning: TypeScript definitions not found"
fi
if [ -f "tsconfig.json" ]; then
echo "✅ TypeScript configuration found"
else
echo "⚠️ Warning: TypeScript configuration not found"
fi
echo ""
echo "🎉 Setup completed successfully!"
echo ""
echo "📋 Available commands:"
echo " pxt build - Build the extension"
echo " pxt serve - Start development server"
echo " pxt deploy - Deploy to micro:bit device"
echo ""
echo "💡 Your development environment is ready!"