Skip to content

Commit

Permalink
skip rm file
Browse files Browse the repository at this point in the history
  • Loading branch information
jazanne committed Feb 2, 2024
1 parent 9014bf7 commit 32bd166
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions internal/aliases/aliases.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,20 @@ func GenerateAliases(opts options.Options, flagKeys []string, diffContents alias
return nil, err
}

gha.Debug("Generating aliases for removed files...")
filePatternAliases := getFilepatternAliases(opts.Aliases)
for _, flag := range flagKeys {
for _, alias := range filePatternAliases {
aliases, err := aliases.GenerateAliasesFromFilePattern(alias, flag, opts.Dir, diffContents)
if err != nil {
// skip aliases that fail to generate
continue
if len(diffContents) > 0 {
gha.Debug("Generating aliases for removed files...")
filePatternAliases := getFilepatternAliases(opts.Aliases)
for _, flag := range flagKeys {
for _, alias := range filePatternAliases {
aliases, err := aliases.GenerateAliasesFromFilePattern(alias, flag, opts.Dir, diffContents)
if err != nil {
// skip aliases that fail to generate
continue
}
aliasesByFlagKey[flag] = append(aliasesByFlagKey[flag], aliases...)
}
aliasesByFlagKey[flag] = append(aliasesByFlagKey[flag], aliases...)
aliasesByFlagKey[flag] = utils.Dedupe(aliasesByFlagKey[flag])
}
aliasesByFlagKey[flag] = utils.Dedupe(aliasesByFlagKey[flag])
}

gha.Log("Finished generating aliases...")
Expand Down

0 comments on commit 32bd166

Please sign in to comment.