(givenPath: string, resolved: string, cwd: string)
| 8 | * Returns '' for relative paths or paths inside cwd (no nudge needed). |
| 9 | */ |
| 10 | export function outsideCwdHint(givenPath: string, resolved: string, cwd: string): string { |
| 11 | if (!path.isAbsolute(givenPath)) return ''; |
| 12 | const rel = path.relative(cwd, resolved); |
| 13 | const inside = rel === '' || (!rel.startsWith('..') && !path.isAbsolute(rel)); |
| 14 | if (inside) return ''; |
| 15 | return ` NOTE: that is an absolute path OUTSIDE your working directory. You are in \`${cwd}\` — use paths relative to it (e.g. \`src/...\`), not invented roots like /home/user or /tmp.`; |
| 16 | } |
no outgoing calls
no test coverage detected