Add CSV folder check

This commit is contained in:
Daniel Mason 2021-09-02 21:40:06 +12:00
parent 8ec1f82a26
commit 6fc5a2b1c5
Signed by: idanoo
GPG key ID: 387387CDBC02F132

View file

@ -144,26 +144,28 @@ func checkForUpdates() {
// Loop through file changes
for _, file := range diff.Files {
if strings.HasSuffix(file.NewName, ".csv") {
for _, hunk := range file.Hunks {
newRange := hunk.WholeRange
for _, line := range newRange.Lines {
if strings.Contains(line.Content, "Start,End,Advice") {
continue
}
if strings.HasPrefix(file.NewName, "locations-of-interest/") {
for _, hunk := range file.Hunks {
newRange := hunk.WholeRange
for _, line := range newRange.Lines {
if strings.Contains(line.Content, "Start,End,Advice") {
continue
}
if line.Mode == diffparser.ADDED {
parseCsvRow("ADDED", line.Content)
if line.Mode == diffparser.ADDED {
parseCsvRow("ADDED", line.Content)
}
// switch changeType := line.Mode; changeType {
// case diffparser.UNCHANGED:
// continue
// case diffparser.ADDED:
// parseCsvRow("ADDED", line.Content)
// case diffparser.REMOVED:
// continue
// // To re-add in future?
// // parseCsvRow("REMOVED", line.Content)
// }
}
// switch changeType := line.Mode; changeType {
// case diffparser.UNCHANGED:
// continue
// case diffparser.ADDED:
// parseCsvRow("ADDED", line.Content)
// case diffparser.REMOVED:
// continue
// // To re-add in future?
// // parseCsvRow("REMOVED", line.Content)
// }
}
}
}