fix config paths

Signed-off-by: FTCHD <144691102+FTCHD@users.noreply.github.com>
This commit is contained in:
FTCHD
2025-09-24 15:56:39 +02:00
parent 6ca45f6bca
commit 1df4213ef8
4 changed files with 26 additions and 10 deletions
+16
View File
@@ -46,3 +46,19 @@ export function buildReadablePath(path: string, type: 'short' | 'long' = 'long')
return `${path.split(':')[0]}:/.../${lastSegment}`
}
export function getConfigParentFolder(path: string) {
console.log('[getConfigParentFolder] path', path)
if (path.endsWith('\\rclone.conf')) {
console.log('[getConfigParentFolder] path ends with \\rclone.conf')
return path.slice(0, -11)
}
if (path.endsWith('/rclone.conf')) {
console.log('[getConfigParentFolder] path ends with /rclone.conf')
return path.slice(0, -11)
}
console.log('[getConfigParentFolder] path does not end with \\rclone.conf or /rclone.conf')
return path
}