chore: restrict custom templates by command (#27297)

This commit is contained in:
andig 2026-02-08 11:27:38 +01:00 • committed by GitHub
parent 3b374f7795
commit 9a9527d224
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 20 additions and 7 deletions

View file

@ -522,8 +522,8 @@ func configureEnvironment(cmd *cobra.Command, conf *globalconfig.All) error {
// setup additional templates
if err == nil {
if cmd.PersistentFlags().Changed(flagTemplate) {
class, err := templates.ClassString(cmd.PersistentFlags().Lookup(flagTemplateType).Value.String())
if cmd.Flags().Changed(flagTemplate) {
class, err := templates.ClassString(cmd.Flags().Lookup(flagTemplateType).Value.String())
if err != nil {
return err
}