make buildReadablePath more readable

This commit is contained in:
FTCHD
2025-02-28 17:59:00 +02:00
parent 14c8e8650f
commit e5723976e9
+7 -3
View File
@@ -35,11 +35,15 @@ export default function Jobs() {
return '' return ''
} }
if (path.includes(':')) {
// returns "REMOTE:/.../LAST_SEGMENT"
return `${path.split(':')[0]}:/.../${path.split(':')[1]?.split('/').slice(-1).join('')}`
}
const slashSymbol = platform() === 'windows' ? '\\' : '/' const slashSymbol = platform() === 'windows' ? '\\' : '/'
return path.split(':')?.[1] // returns "LAST_SEGMENT"
? `${path.split(':')[0]}:${slashSymbol}...${slashSymbol}${path.split(':')[1]?.split(slashSymbol).slice(-1).join('')}` return path.split(slashSymbol).slice(-1).join('')
: path.split(':')?.[0]?.split(slashSymbol).slice(-1).join('')
}, []) }, [])
useEffect(() => { useEffect(() => {