Skip to content

Commit

Permalink
remove region from name of s3 and iam csv files
Browse files Browse the repository at this point in the history
  • Loading branch information
chinmaysomani07 committed Feb 10, 2023
1 parent e14c771 commit b8ec059
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/view/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ func (t *Table) importAsCSV(evt *tcell.EventKey) *tcell.EventKey {
if err != nil {
log.Info().Msg(fmt.Sprintf("error in creating csv directory: %v", err))
}
path = filepath.Join(path + "/" + csvFileName[len(csvFileName)-2] + "-" + profile + "-" + region + ".csv")
if csvFileName[len(csvFileName)-2] == "S3" || strings.Contains(csvFileName[len(csvFileName)-2], "IAM") {
path = filepath.Join(path + "/" + csvFileName[len(csvFileName)-2] + "-" + profile + ".csv")
} else {
path = filepath.Join(path + "/" + csvFileName[len(csvFileName)-2] + "-" + profile + "-" + region + ".csv")
}
file, err := os.Create(path)
if err != nil {
log.Info().Msg(fmt.Sprintf("error in creating csv file: %v", err))
Expand Down

0 comments on commit b8ec059

Please sign in to comment.