Skip to content

Instantly share code, notes, and snippets.

@victorhenrion
Last active November 25, 2023 04:09
Show Gist options
  • Select an option

  • Save victorhenrion/5217a668544e88790e545cbe6914d34e to your computer and use it in GitHub Desktop.

Select an option

Save victorhenrion/5217a668544e88790e545cbe6914d34e to your computer and use it in GitHub Desktop.

Revisions

  1. victorhenrion renamed this gist Jul 7, 2023. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. victorhenrion renamed this gist Jul 7, 2023. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. victorhenrion revised this gist Jul 7, 2023. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions command
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    curl https://gist.githubusercontent.com/vpctorr/5217a668544e88790e545cbe6914d34e/raw/75420dcf22e73b80f027d3dd81dd42315284b044/turf_types_patch.sh | bash
  4. victorhenrion revised this gist Jul 7, 2023. No changes.
  5. victorhenrion renamed this gist Jul 7, 2023. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  6. victorhenrion created this gist Jul 7, 2023.
    14 changes: 14 additions & 0 deletions script.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    #!/bin/bash

    directory="node_modules/@turf"
    for subdir in $directory/*; do
    package="$subdir/package.json"
    if [[ -f "$package" ]]; then
    types_value=$(jq -r .types $package)
    if [[ "$types_value" != "null" ]]; then
    types_value="./$types_value"
    new_content=$(jq --arg types "$types_value" '.exports["."].types = $types' $package)
    echo "$new_content" > $package
    fi
    fi
    done