Skip to content

Commit 51bb09c

Browse files
committed
fix: adding windows debugging
1 parent ca45c00 commit 51bb09c

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

packages/cta-engine/src/file-helpers.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ export function relativePath(from: string, to: string) {
4040
const cleanedFrom = from.startsWith('./') ? from.slice(2) : from
4141
const cleanedTo = to.startsWith('./') ? to.slice(2) : to
4242

43+
if (process.env.CTA_DEBUG) {
44+
console.log('from', from)
45+
console.log('to', to)
46+
console.log('cleanedFrom', cleanedFrom)
47+
console.log('cleanedTo', cleanedTo)
48+
}
49+
4350
const fromSegments = cleanedFrom.split('/')
4451
const toSegments = cleanedTo.split('/')
4552

packages/cta-engine/tests/file-helper.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ describe('relativePath', () => {
4747
),
4848
).toBe('../integrations/tanstack-query/layout.tsx')
4949
})
50+
// it('windows', () => {
51+
// expect(
52+
// relativePath(
53+
// 'c:\\test-app\\src\\main.tsx',
54+
// 'src/integrations/tanstack-query/root-provider.tsx',
55+
// ),
56+
// ).toBe('./integrations/tanstack-query/root-provider.tsx')
57+
// })
5058
})
5159

5260
describe('readFileHelper', () => {

0 commit comments

Comments
 (0)