diff --git a/internal/plugin/database.go b/internal/plugin/database.go index d5d6f60..2f9a89f 100644 --- a/internal/plugin/database.go +++ b/internal/plugin/database.go @@ -38,9 +38,9 @@ func (d *PluginDatabase) Save() error { d.saveMutex.Lock() defer d.saveMutex.Unlock() - file, err := os.Create(databaseFile) + file, err := os.Create(databaseFile + ".tmp") if err != nil { - return fmt.Errorf("failed to create plugin database: %v", err) + return fmt.Errorf("failed to create plugin database tmp: %v", err) } defer file.Close() @@ -50,5 +50,9 @@ func (d *PluginDatabase) Save() error { return fmt.Errorf("failed to encode plugin database: %v", err) } + if err := os.Rename(databaseFile+".tmp", databaseFile); err != nil { + return fmt.Errorf("failed to move plugin database to active file: %v", err) + } + return nil } diff --git a/ui/src/components/UploadPluginDialog.tsx b/ui/src/components/UploadPluginDialog.tsx index 5cbd4ad..b0c4f02 100644 --- a/ui/src/components/UploadPluginDialog.tsx +++ b/ui/src/components/UploadPluginDialog.tsx @@ -576,7 +576,7 @@ function InstallPluginView({ description={ !manifest ? `Extracting plugin from ${filename}...` : - `Do you want to install the plugin?` + `Do you want to install this plugin?` } /> {manifest && (