Skip to content

Commit

Permalink
fix recursive copying during update
Browse files Browse the repository at this point in the history
  • Loading branch information
5rahim committed Jun 1, 2024
1 parent 558a15b commit 5a67489
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 9 additions & 2 deletions internal/updater/selfupdate.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ func (su *SelfUpdater) recover() {
// continue
//}

if entry.Name() == backupDirName {
continue
}

if !strings.HasSuffix(entry.Name(), ".old") {
_ = os.RemoveAll(filepath.Join(exeDir, entry.Name()))
continue
Expand Down Expand Up @@ -188,11 +192,14 @@ func (su *SelfUpdater) Run() error {
return err
}

// Backup the current assets
// Delete the backup directory if it exists
_ = os.RemoveAll(filepath.Join(exeDir, backupDirName))
// Create the backup directory
backupDir := filepath.Join(exeDir, backupDirName)
_ = os.MkdirAll(backupDir, 0755)
// Backup the current assets
for _, entry := range entries {
if entry.Name() == tempReleaseDir {
if entry.Name() == tempReleaseDir || entry.Name() == backupDirName {
continue
}
if !entry.IsDir() {
Expand Down
3 changes: 1 addition & 2 deletions seanime-web/src/app/(main)/server-data-wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ export function ServerDataWrapper(props: ServerDataWrapperProps) {
<img src="/logo_2.png" alt="logo" className="w-36 h-auto" />
</div>
<p className="text-center text-lg">
The app is currently updating. Once the update is complete and the connection has been reestablished, please <strong>refresh the
page</strong>.
Seanime is currently updating. Refresh the page once the update is complete and the connection has been reestablished.
</p>
</div>
}
Expand Down

0 comments on commit 5a67489

Please sign in to comment.