mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-18 08:06:59 +00:00
GODT-1117 Do not change updates location for Bridge now
This commit is contained in:
@ -50,7 +50,7 @@ func migrateFiles(configName string) error {
|
|||||||
if err := migrateCacheFromBoth15xAnd16x(locations, userCacheDir); err != nil {
|
if err := migrateCacheFromBoth15xAnd16x(locations, userCacheDir); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := migrateUpdatesFrom16x(locations); err != nil {
|
if err := migrateUpdatesFrom16x(configName, locations); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@ -91,7 +91,15 @@ func migrateCacheFromBoth15xAnd16x(locations *locations.Locations, userCacheDir
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func migrateUpdatesFrom16x(locations *locations.Locations) error {
|
func migrateUpdatesFrom16x(configName string, locations *locations.Locations) error {
|
||||||
|
// In order to properly update Bridge 1.6.X and higher we need to
|
||||||
|
// change the launcher first. Since this is not part of automatic
|
||||||
|
// updates the migration must wait until manual update. Until that
|
||||||
|
// we need to keep old path.
|
||||||
|
if configName == "bridge" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
oldUpdatesPath := locations.GetOldUpdatesPath()
|
oldUpdatesPath := locations.GetOldUpdatesPath()
|
||||||
// Do not use ProvideUpdatesPath, that creates dir right away.
|
// Do not use ProvideUpdatesPath, that creates dir right away.
|
||||||
newUpdatesPath := locations.GetUpdatesPath()
|
newUpdatesPath := locations.GetUpdatesPath()
|
||||||
|
|||||||
@ -189,6 +189,14 @@ func (l *Locations) getCachePath() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (l *Locations) getUpdatesPath() string {
|
func (l *Locations) getUpdatesPath() string {
|
||||||
|
// In order to properly update Bridge 1.6.X and higher we need to
|
||||||
|
// change the launcher first. Since this is not part of automatic
|
||||||
|
// updates the migration must wait until manual update. Until that
|
||||||
|
// we need to keep old path.
|
||||||
|
if l.configName == "bridge" {
|
||||||
|
return l.GetOldUpdatesPath()
|
||||||
|
}
|
||||||
|
|
||||||
// Users might use tools to regularly clear caches, which would mean always
|
// Users might use tools to regularly clear caches, which would mean always
|
||||||
// removing updates, therefore Bridge updates have to be somewhere else.
|
// removing updates, therefore Bridge updates have to be somewhere else.
|
||||||
return filepath.Join(l.userConfig, "updates")
|
return filepath.Join(l.userConfig, "updates")
|
||||||
|
|||||||
Reference in New Issue
Block a user