Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions artifactory/commands/dotnet/dotnetcommand.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,11 @@ func RemoveSourceFromNugetConfigIfExists(cmdType dotnet.ToolchainType) error {
cmd.CommandFlags = append(cmd.CommandFlags, "-name", SourceName)
}

stdOut, stdErr, _, err := frogio.RunCmdWithOutputParser(cmd, false)
if err != nil {
if strings.Contains(stdOut+stdErr, "Unable to find") || strings.Contains(stdOut+stdErr, "does not exist") {
return nil
}
return errorutils.CheckErrorf("%s\nfailed to remove source: %s", stdErr, err.Error())
}
// nolint:errcheck
// Ignore errors since this is just a cleanup function.
// We don't want cleanup failures to break the main flow.
// It's also fine if the source doesn't exist.
_, _, _, _ = frogio.RunCmdWithOutputParser(cmd, false)
return nil
}

Expand Down
Loading