@mallardbay/cursor-rules 1.0.18 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/setup-cursor.sh +11 -26
- package/package.json +1 -1
package/bin/setup-cursor.sh
CHANGED
|
@@ -43,25 +43,18 @@ SRC_DIR="$(cd "$SCRIPT_DIR/.." && pwd -P)"
|
|
|
43
43
|
|
|
44
44
|
# When run via npx, if .cursor doesn't exist at SRC_DIR, find the actual package location
|
|
45
45
|
if [ ! -d "$SRC_DIR/.cursor/shared/skills" ]; then
|
|
46
|
-
# Try multiple possible locations for the package
|
|
46
|
+
# Try multiple possible locations for the package (using individual checks instead of array for sh compatibility)
|
|
47
47
|
# When SRC_DIR is node_modules, package is at SRC_DIR/@mallardbay/cursor-rules
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"$SRC_DIR/node_modules/@mallardbay/cursor-rules"
|
|
52
|
-
|
|
53
|
-
"$(dirname "$
|
|
54
|
-
)
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
SRC_DIR="$location"
|
|
59
|
-
break
|
|
60
|
-
fi
|
|
61
|
-
done
|
|
62
|
-
|
|
63
|
-
# If still not found, search for package.json with our name
|
|
64
|
-
if [ ! -d "$SRC_DIR/.cursor/shared/skills" ]; then
|
|
48
|
+
if [ -d "$SRC_DIR/@mallardbay/cursor-rules/.cursor/shared/skills" ]; then
|
|
49
|
+
SRC_DIR="$SRC_DIR/@mallardbay/cursor-rules"
|
|
50
|
+
elif [ -d "$SRC_DIR/node_modules/@mallardbay/cursor-rules/.cursor/shared/skills" ]; then
|
|
51
|
+
SRC_DIR="$SRC_DIR/node_modules/@mallardbay/cursor-rules"
|
|
52
|
+
elif [ -d "$(dirname "$SRC_DIR")/@mallardbay/cursor-rules/.cursor/shared/skills" ]; then
|
|
53
|
+
SRC_DIR="$(dirname "$SRC_DIR")/@mallardbay/cursor-rules"
|
|
54
|
+
elif [ -d "$(dirname "$(dirname "$SRC_DIR")")/@mallardbay/cursor-rules/.cursor/shared/skills" ]; then
|
|
55
|
+
SRC_DIR="$(dirname "$(dirname "$SRC_DIR")")/@mallardbay/cursor-rules"
|
|
56
|
+
else
|
|
57
|
+
# If still not found, search for package.json with our name
|
|
65
58
|
PACKAGE_ROOT=$(find "$(dirname "$SRC_DIR")" -maxdepth 5 -type f -name "package.json" -exec grep -l '"name":\s*"@mallardbay/cursor-rules"' {} \; 2>/dev/null | head -1 | xargs dirname 2>/dev/null)
|
|
66
59
|
if [ -n "$PACKAGE_ROOT" ] && [ -d "$PACKAGE_ROOT/.cursor/shared/skills" ]; then
|
|
67
60
|
SRC_DIR="$PACKAGE_ROOT"
|
|
@@ -69,9 +62,6 @@ if [ ! -d "$SRC_DIR/.cursor/shared/skills" ]; then
|
|
|
69
62
|
fi
|
|
70
63
|
fi
|
|
71
64
|
|
|
72
|
-
echo "DEBUG: Final SRC_DIR=$SRC_DIR"
|
|
73
|
-
echo "DEBUG: Checking if .cursor/shared/skills exists: $([ -d "$SRC_DIR/.cursor/shared/skills" ] && echo "YES" || echo "NO")"
|
|
74
|
-
|
|
75
65
|
SHARED_DIR="$SRC_DIR/.cursor/shared/rules"
|
|
76
66
|
FRONTEND_DIR="$SRC_DIR/.cursor/frontend/rules"
|
|
77
67
|
FRONTEND_LIB_DIR="$SRC_DIR/.cursor/frontend-lib/rules"
|
|
@@ -98,7 +88,6 @@ copy_rules() {
|
|
|
98
88
|
|
|
99
89
|
copy_skills() {
|
|
100
90
|
local DIR="$1"
|
|
101
|
-
echo "DEBUG: Checking skills directory: $DIR"
|
|
102
91
|
if [ -d "$DIR" ]; then
|
|
103
92
|
echo "Copying skills from: $DIR"
|
|
104
93
|
# Ensure target directories exist
|
|
@@ -137,8 +126,6 @@ copy_skills() {
|
|
|
137
126
|
fi
|
|
138
127
|
else
|
|
139
128
|
echo "Warning: Skills directory not found: $DIR"
|
|
140
|
-
echo "DEBUG: SRC_DIR=$SRC_DIR"
|
|
141
|
-
echo "DEBUG: SHARED_SKILLS_DIR=$SHARED_SKILLS_DIR"
|
|
142
129
|
fi
|
|
143
130
|
}
|
|
144
131
|
|
|
@@ -170,8 +157,6 @@ copy_rules "$SHARED_DIR"
|
|
|
170
157
|
append_to_claude_md "$SHARED_DIR"
|
|
171
158
|
|
|
172
159
|
# Always include shared skills
|
|
173
|
-
echo "DEBUG: SRC_DIR=$SRC_DIR"
|
|
174
|
-
echo "DEBUG: SHARED_SKILLS_DIR=$SHARED_SKILLS_DIR"
|
|
175
160
|
copy_skills "$SHARED_SKILLS_DIR"
|
|
176
161
|
|
|
177
162
|
# Inheritance handling
|