From eaa90d83dfe92b50f9d8de548afce322aee9d4be Mon Sep 17 00:00:00 2001 From: litruv Date: Tue, 13 Oct 2026 14:32:08 +1100 Subject: [PATCH] Fix plugin install failing with EXDEV when temp and userData are on different filesystems --- README.md | 2 +- electron/main.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9cb94c8..9d30c9a 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Paarrot includes a plugin system for extending and customising the app with Java 1. Drop a plugin folder into your plugins directory: - **Windows**: `%APPDATA%\paarrot\plugins\\` - - **Linux**: `~/.config/Paarrot/plugins//` + - **Linux**: `~/.config/Paarrot/plugins//` for the packaged app, `~/.config/paarrot/plugins//` when running from source - **macOS**: `~/Library/Application Support/Paarrot/plugins//` 2. Enable it in **Settings → Plugins → Installed** diff --git a/electron/main.js b/electron/main.js index 12461f4..cd1c55f 100644 --- a/electron/main.js +++ b/electron/main.js @@ -1758,7 +1758,7 @@ ipcMain.handle('plugin:download', async (event, { pluginId, downloadUrl, name }) }); } }).on('error', (err) => { - fs.unlinkSync(tempZipPath); + fs.rmSync(tempZipPath, { force: true }); reject(err); }); }); @@ -1788,13 +1788,14 @@ ipcMain.handle('plugin:download', async (event, { pluginId, downloadUrl, name }) } } - // Move contents to final plugin directory + // Move contents to final plugin directory. renameSync throws EXDEV when + // temp and userData are on different filesystems (Linux: /tmp is tmpfs). fs.mkdirSync(pluginDir, { recursive: true }); const files = fs.readdirSync(sourceDir); for (const file of files) { const srcPath = path.join(sourceDir, file); const destPath = path.join(pluginDir, file); - fs.renameSync(srcPath, destPath); + fs.cpSync(srcPath, destPath, { recursive: true }); } // Clean up temp extract dir