mirror of
https://github.com/rclone/rclone.git
synced 2024-11-07 17:14:44 +01:00
plugins: Move plugins cache path initialization to initPluginsOrError.
Fixes #4951.
This commit is contained in:
parent
f5af761466
commit
6272ca74bc
@ -68,13 +68,6 @@ var (
|
||||
initMutex = &sync.Mutex{}
|
||||
)
|
||||
|
||||
func init() {
|
||||
cachePath = filepath.Join(config.CacheDir, "webgui")
|
||||
PluginsPath = filepath.Join(cachePath, "plugins")
|
||||
pluginsConfigPath = filepath.Join(PluginsPath, "config")
|
||||
|
||||
}
|
||||
|
||||
// Plugins represents the structure how plugins are saved onto disk
|
||||
type Plugins struct {
|
||||
mutex sync.Mutex
|
||||
@ -96,6 +89,9 @@ func initPluginsOrError() error {
|
||||
initMutex.Lock()
|
||||
defer initMutex.Unlock()
|
||||
if !initSuccess {
|
||||
cachePath = filepath.Join(config.CacheDir, "webgui")
|
||||
PluginsPath = filepath.Join(cachePath, "plugins")
|
||||
pluginsConfigPath = filepath.Join(PluginsPath, "config")
|
||||
loadedPlugins = newPlugins(availablePluginsJSONPath)
|
||||
err := loadedPlugins.readFromFile()
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user