Skip to content

Commit

Permalink
add handy build task for exercises in csv format
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhonas committed Jun 6, 2023
1 parent 45d34ca commit 7c6f18e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ dist/exercises.nd.json: ./exercises/**.json
# output to new line delimited JSON
# for use to import into PostgreSQL via the COPY command
#
# https://konbert.com/blog/import-json-into-postgres-using-copy
# https://konbert.com/blog/import-json-into-postgres-using-copy
# https://www.postgresql.org/docs/current/sql-copy.html
jq -s '.[]' ./exercises/**.json > ./dist/exercises.nd.json

dist/exercises.csv: dist/exercises.json
# output to csv format
# requires in2csv which is part of
# https://csvkit.readthedocs.io/
in2csv ./dist/exercises.json > ./dist/exercises.csv

0 comments on commit 7c6f18e

Please sign in to comment.