make buildReadablePath more readable
This commit is contained in:
+7
-3
@@ -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(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user