Skip to content

Commit b6c0305

Browse files
committed
Fix up path generation util
1 parent b01ca40 commit b6c0305

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/lib/paths.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,15 +324,13 @@ export function getFilePathRelativeToProject(
324324
return absoluteFilePath.slice(projectIndexInPath + sliceOffset) ?? ''
325325
}
326326

327-
/** Gets our "archive" directory for deletion/restoration, within the electron userData path */
327+
/** */
328328
async function getArchiveBasePath() {
329-
return `${window.electron ? await window.electron.getPathUserData() : '/'}'${ARCHIVE_DIR}`
329+
return window.electron
330+
? window.electron.join(await window.electron.getPathUserData(), ARCHIVE_DIR)
331+
: `/${ARCHIVE_DIR}`
330332
}
331333

332-
/**
333-
* Our archive simply mirrors the absolute location on disk for the item
334-
* being archived, joining it with the archive base path.
335-
*/
336334
export async function toArchivePath(absolutePath: string) {
337335
const basePath = await getArchiveBasePath()
338336
return window.electron

0 commit comments

Comments
 (0)