Skip to content

Commit 84d6437

Browse files
committed
feat: fix output file path in GTFS update script and improve line processing logic
1 parent a98839c commit 84d6437

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

.github/workflows/update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ jobs:
3939
cd gtfs-branch
4040
chmod +x gradlew
4141
./gradlew updateGtfs --args="../input.zip ./files/$(date +'%Y-%m-%d').zip ../cache.tsv ${{ secrets.MAPYCZ_API_KEY }}"
42-
cp ./files/$(date +'%Y-%m-%d').zip ../files/latest.zip
42+
cp ./files/$(date +'%Y-%m-%d').zip ./files/latest.zip
4343
git push https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git gtfs

src/main/kotlin/dev/aa55h/gtfs/processor/Processors.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ import java.nio.file.Path
99

1010
class StripLinesProcessor(val toRemove: Set<String>) : Processor {
1111
override fun process(input: Path) {
12-
val lines = Files.lines(input).parallel()
13-
.filter { line -> toRemove.none { line.contains(it) } }
14-
.toList()
12+
val lines = Files.lines(input).use { stream ->
13+
stream.parallel()
14+
.filter { line -> toRemove.none { line.contains(it) } }
15+
.toList()
16+
}
1517

1618
val totalLines = Files.lines(input).count()
1719
val removed = totalLines - lines.size

0 commit comments

Comments
 (0)