mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-19 13:33:35 +08:00
优化Win显示路径
让Win跟Linux一样可以显示缩短路径 以前 C:\Users\test\project\src\index.ts 现在 …/project/src/index.ts
This commit is contained in:
parent
d1e684c419
commit
d79959c355
@ -223,7 +223,7 @@ function formatToolSummary(tool: string, inp: Record<string, unknown>): string |
|
||||
}
|
||||
|
||||
function shortPath(fp: string): string {
|
||||
const parts = fp.split('/')
|
||||
const parts = fp.replaceAll('\\', '/').split('/')
|
||||
return parts.length > 3 ? '…/' + parts.slice(-3).join('/') : fp
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user