dx: correctly print Windows sources field on non-Windows systems
Massimo Melina committed
Dec 12, 2023 at 17:37 UTC
9c44ae852a79e69d84643617b1556de7e82e0b86
1 file changed
+2
src/vfs.ts
+2
@@ -160,6 +160,8 @@ export function getNodeName(node: VfsNode) {
160
const base = basename(source)
161
if (/^[./\\]*$/.test(base)) // if empty or special-chars-only
162
return basename(resolve(source)) // resolve to try to get more
163
+ if (base.includes('\\')) // source was Windows but now we are running posix. This probably happens only debugging, so it's DX
164
+ return source.slice(source.lastIndexOf('\\') + 1)
165
return base
166
}
167