Skip to content

Commit cf9b345

Browse files
authored
Fix - Failed to read plugins directory error (#226)
Signed-off-by: Smyslov Maxim <[email protected]>
1 parent cb24803 commit cf9b345

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

cmd/d8/root.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ func NewRootCommand() *RootCommand {
8080
},
8181
}
8282

83+
envCliPath := os.Getenv("DECKHOUSE_CLI_PATH")
84+
if envCliPath != "" {
85+
flags.DeckhousePluginsDir = envCliPath
86+
}
87+
8388
rootCmd.registerCommands()
8489
rootCmd.cmd.SetGlobalNormalizationFunc(cliflag.WordSepNormalizeFunc)
8590

@@ -105,9 +110,14 @@ func (r *RootCommand) registerCommands() {
105110

106111
r.cmd.AddCommand(plugins.NewPluginsCommand(r.logger.Named("plugins-command")))
107112

113+
err := os.MkdirAll(flags.DeckhousePluginsDir+"/plugins", 0755)
114+
if err != nil {
115+
r.logger.Debug("Failed to create plugins directory", slog.String("error", err.Error()))
116+
}
117+
108118
path, err := os.ReadDir(flags.DeckhousePluginsDir + "/plugins")
109119
if err != nil {
110-
r.logger.Warn("Failed to read plugins directory", slog.String("error", err.Error()))
120+
r.logger.Debug("Failed to read plugins directory", slog.String("error", err.Error()))
111121
}
112122

113123
for _, plugin := range path {

0 commit comments

Comments
 (0)