fix pre-commit and cleanup

This commit is contained in:
Kjeld Schouten
2024-10-19 15:18:05 +02:00
parent 2acb59c9dc
commit 4ab41d42f2
203 changed files with 8456 additions and 8484 deletions
+23 -23
View File
@@ -1,37 +1,37 @@
package cmd
import (
"path/filepath"
"path/filepath"
"github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/fluxhandler"
"github.com/truecharts/public/clustertool/pkg/initfiles"
"github.com/spf13/cobra"
"github.com/truecharts/public/clustertool/pkg/fluxhandler"
"github.com/truecharts/public/clustertool/pkg/initfiles"
)
var hrinstall = &cobra.Command{
Use: "install",
Short: "install a helm-release file without flux, helm-release file needs to be called helm-release.yaml",
Run: func(cmd *cobra.Command, args []string) {
initfiles.LoadTalEnv()
Use: "install",
Short: "install a helm-release file without flux, helm-release file needs to be called helm-release.yaml",
Run: func(cmd *cobra.Command, args []string) {
initfiles.LoadTalEnv()
var dir string
var dir string
// Check if args[0] includes a filename
if filename := filepath.Base(args[0]); filename != "" && filename != "." && filename != "/" {
dir = filepath.Dir(args[0])
} else {
dir = args[0] // Assuming args[0] is just a directory path without a filename
}
helmRepoPath := filepath.Join("./repositories", "helm")
helmRepos, _ := fluxhandler.LoadAllHelmRepos(helmRepoPath)
intermediateCharts := []fluxhandler.HelmChart{
{dir, false, true},
}
// Check if args[0] includes a filename
if filename := filepath.Base(args[0]); filename != "" && filename != "." && filename != "/" {
dir = filepath.Dir(args[0])
} else {
dir = args[0] // Assuming args[0] is just a directory path without a filename
}
helmRepoPath := filepath.Join("./repositories", "helm")
helmRepos, _ := fluxhandler.LoadAllHelmRepos(helmRepoPath)
intermediateCharts := []fluxhandler.HelmChart{
{dir, false, true},
}
fluxhandler.InstallCharts(intermediateCharts, helmRepos, false)
},
fluxhandler.InstallCharts(intermediateCharts, helmRepos, false)
},
}
func init() {
helmrelease.AddCommand(hrinstall)
helmrelease.AddCommand(hrinstall)
}