File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 1
1
# Source
2
2
src /
3
+ ! src /prompts /
3
4
tests /
4
5
5
6
# CI/CD
Original file line number Diff line number Diff line change 10
10
"type" : " module" ,
11
11
"files" : [
12
12
" lib/**/*" ,
13
- " bin/**/*"
13
+ " bin/**/*" ,
14
+ " src/prompts/**/*"
14
15
],
15
16
"scripts" : {
16
17
"build" : " rimraf lib && tsc -p tsconfig.json --sourceMap --declaration" ,
Original file line number Diff line number Diff line change @@ -40,10 +40,19 @@ export async function rulesGenerate(
40
40
// 4. Read guidelines file
41
41
let guidelinesText : string ;
42
42
try {
43
- guidelinesText = await readGuidelines ( './src/prompts/cursor_mdc.md' ) ;
43
+ guidelinesText = await readGuidelines ( '.. /src/prompts/cursor_mdc.md' ) ;
44
44
} catch ( _error ) {
45
- console . log ( pc . yellow ( 'Warning: Could not read guidelines. Error: ' + _error + '. Using built-in guidelines.' ) ) ;
46
- guidelinesText = generateMockGuidelines ( ) ;
45
+ // If not found in src/prompts, try with a path relative to the current file
46
+ try {
47
+ const modulePath = new URL ( import . meta. url ) . pathname ;
48
+ const moduleDir = path . dirname ( modulePath ) ;
49
+ const alternativePath = path . resolve ( moduleDir , '../src/prompts/cursor_mdc.md' ) ;
50
+
51
+ guidelinesText = await fs . readFile ( alternativePath , 'utf-8' ) ;
52
+ } catch ( innerError ) {
53
+ console . log ( pc . yellow ( 'Warning: Could not read guidelines. Error: ' + innerError + '. Using built-in guidelines.' ) ) ;
54
+ guidelinesText = generateMockGuidelines ( ) ;
55
+ }
47
56
}
48
57
49
58
console . log ( pc . cyan ( '3. Generating cursor rules...' ) ) ;
You can’t perform that action at this time.
0 commit comments