mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-27 15:17:38 +00:00
Fix Windows drive letter support in path formatting regex
- Update regex pattern to support all drive letters A-Z (not just C:) - Fix linting warning about unnecessary escape in character class - Now properly handles paths like D:\Users\, E:\Users\, etc.
This commit is contained in:
parent
c8234ded90
commit
816247d8ad
1 changed files with 1 additions and 1 deletions
|
|
@ -20,7 +20,7 @@
|
||||||
* formatPathForDisplay('/home/bob/projects') // returns '~/projects'
|
* formatPathForDisplay('/home/bob/projects') // returns '~/projects'
|
||||||
*/
|
*/
|
||||||
// Compile regex once for better performance
|
// Compile regex once for better performance
|
||||||
const HOME_PATTERN = /^(?:\/Users\/[^/]+|\/home\/[^/]+|[Cc]:[\/\\]Users[\/\\][^\/\\]+|\/root)/;
|
const HOME_PATTERN = /^(?:\/Users\/[^/]+|\/home\/[^/]+|[A-Za-z]:[\/\\]Users[\/\\][^\/\\]+|\/root)/;
|
||||||
|
|
||||||
export function formatPathForDisplay(path: string): string {
|
export function formatPathForDisplay(path: string): string {
|
||||||
if (!path) return '';
|
if (!path) return '';
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue