Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchitram1 committed Oct 18, 2024
1 parent 561b888 commit 33b99f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package_managers/homebrew/pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set -exu
NOW=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
mkdir -p "$DATA_DIR"/"$NOW"

# extract
if [ "$FETCH" = true ]; then
# extract
curl -s "$SOURCE" > "$DATA_DIR"/"$NOW"/source.json

# make a symlink called latest, pointing to $NOW
Expand All @@ -16,7 +16,7 @@ if [ "$FETCH" = true ]; then
for x in "$JQ_DIR"/*.jq; do
filename=$(basename "$x" .jq)
# first jq line uses the formulas defined in the jq folder to get the fields we need
# second jq line transforms the json into csv
# second jq line transforms the json into csv so we can use sed to clean it up
jq -f "$x" "$DATA_DIR"/latest/source.json \
| jq -r '
(map(keys) | add | unique) as $cols |
Expand Down
2 changes: 1 addition & 1 deletion package_managers/homebrew/sed/packages.sed
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
1d
's/"\([^"]*\)","\([^"]*\)","\([^"]*\)",*/INSERT INTO package (derived_id, import_id, name, readme) VALUES ("\1", "\2", "\3", NULL);/'
's/"\([^"]*\)","\([^"]*\)","\([^"]*\)",*/INSERT INTO packages (derived_id, import_id, name) VALUES ("\1", "\2", "\3");/'

0 comments on commit 33b99f0

Please sign in to comment.