Skip to content

Commit

Permalink
Handle unspecified input files
Browse files Browse the repository at this point in the history
  • Loading branch information
stonish authored and --global committed Jun 8, 2022
1 parent 11184f1 commit fccf994
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions transactions/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ func Process(revolutFile string, aibFile string, startDate time.Time) {
fmt.Println("Excluding transactions on and before ", startDate)
report := NewReport(startDate)

revolutLines := utils.ReadInputFile(revolutFile)
aibLines := utils.ReadInputFile(aibFile)
if revolutFile != "" {
revolutLines := utils.ReadInputFile(revolutFile)
report = report.AddTransactions(revolutLines, true)
}

report = report.AddTransactions(revolutLines, true)
report = report.AddTransactions(aibLines, false)
if aibFile != "" {
aibLines := utils.ReadInputFile(aibFile)
report = report.AddTransactions(aibLines, false)
}

report.Sort()
report.Output()
Expand Down

0 comments on commit fccf994

Please sign in to comment.