-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanual_test.sh
More file actions
executable file
·59 lines (48 loc) · 1.79 KB
/
Copy pathmanual_test.sh
File metadata and controls
executable file
·59 lines (48 loc) · 1.79 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
#!/bin/bash
# Manual test script for iconmate add command
# This script tests the exact command you mentioned:
# iconmate add --folder ./src/assets/icons/ --icon heroicons:heart --name Heart
set -e # Exit on any error
echo "🔧 Building iconmate binary..."
cargo build --release
echo "📁 Creating test directory..."
TEST_DIR=$(mktemp -d)
cd "$TEST_DIR"
echo "Test directory: $TEST_DIR"
echo "🚀 Running iconmate add command..."
"$OLDPWD/target/debug/iconmate" add --folder ./src/assets/icons/ --icon heroicons:heart --name Heart
echo "📋 Verifying results..."
echo "1. Checking if src/assets/icons/ directory exists..."
if [ -d "src/assets/icons/" ]; then
echo "✅ Directory src/assets/icons/ exists"
else
echo "❌ Directory src/assets/icons/ does not exist"
exit 1
fi
echo "2. Checking if index.ts file exists..."
if [ -f "src/assets/icons/index.ts" ]; then
echo "✅ File index.ts exists"
echo " Content:"
cat src/assets/icons/index.ts
else
echo "❌ File index.ts does not exist"
exit 1
fi
echo "3. Checking if heroicons:heart.svg file exists..."
if [ -f "src/assets/icons/heroicons:heart.svg" ]; then
echo "✅ File heroicons:heart.svg exists"
echo " SVG size: $(wc -c < src/assets/icons/heroicons:heart.svg) bytes"
echo " First line: $(head -n 1 src/assets/icons/heroicons:heart.svg)"
else
echo "❌ File heroicons:heart.svg does not exist"
exit 1
fi
echo "🧹 Cleaning up test directory..."
cd "$OLDPWD"
rm -rf "$TEST_DIR"
echo "✅ All tests passed! The command works as expected."
# Expected behavior:
# - Creates folder: src/assets/icons/
# - Creates file: src/assets/icons/index.ts with content:
# export { default as IconHeart } from './heroicons:heart.svg';
# - Creates file: src/assets/icons/heroicons:heart.svg with valid SVG content