Skip to content

Commit

Permalink
fix: add prefix understanding to IsVendorCmd (#2052)
Browse files Browse the repository at this point in the history
## Description

Another fix for Zarf UI split - this makes vendor commands aware of the
Zarf command prefix.

## Related Issue

Relates to #1814 

## Type of change

- [X] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow)
followed
  • Loading branch information
Racer159 authored Oct 4, 2023
1 parent 43783f5 commit f555e8a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cmd/common/vendor.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"slices"

"github.com/defenseunicorns/zarf/src/config"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -46,6 +47,10 @@ func CheckVendorOnlyFromPath(cmd *cobra.Command) bool {

// IsVendorCmd checks if the command is a vendor command.
func IsVendorCmd(args []string, vendoredCmds []string) bool {
if config.ActionsCommandZarfPrefix != "" {
args = args[1:]
}

if len(args) > 2 {
if args[1] == "tools" || args[1] == "t" {
if slices.Contains(vendoredCmds, args[2]) {
Expand Down

0 comments on commit f555e8a

Please sign in to comment.