Skip to content

Commit

Permalink
backend: plugins: Remove .plugins from watch list
Browse files Browse the repository at this point in the history
This fix prevents the development app (when running npm run dev-only-app) from watching for static plugins locally, which causes an endless loop of refreshes to the app.

Fixes: #1937

Signed-off-by: Evangelos Skopelitis <eskopelitis@microsoft.com>
  • Loading branch information
skoeva committed May 2, 2024
1 parent ce248d6 commit 848c83f
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions backend/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,19 +179,14 @@ func defaultPluginDir() string {
// - "./.plugins" if the ~/.config/Headlamp/plugins can't be made.
// Windows: %APPDATA%\Headlamp\Config\plugins
// (for example, C:\Users\USERNAME\AppData\Roaming\Headlamp\Config\plugins)
pluginDirDefault := "./.plugins"

if folderExists(pluginDirDefault) {
return pluginDirDefault
}

// https://www.npmjs.com/package/env-paths
// https://pkg.go.dev/os#UserConfigDir
userConfigDir, err := os.UserConfigDir()
if err != nil {
logger.Log(logger.LevelError, nil, err, "getting user config dir")

return pluginDirDefault
return "./.plugins"
}

pluginsConfigDir := filepath.Join(userConfigDir, "Headlamp", "plugins")
Expand All @@ -207,7 +202,7 @@ func defaultPluginDir() string {
if err != nil {
logger.Log(logger.LevelError, nil, err, "creating plugins directory")

return pluginDirDefault
return "./.plugins"
}

return pluginsConfigDir
Expand Down

0 comments on commit 848c83f

Please sign in to comment.