Created
April 11, 2022 05:32
-
-
Save yspreen/5fd578f7fbbf7b3f2ce90f78eefe23aa to your computer and use it in GitHub Desktop.
extract-js-map.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
mapfile="$1" | |
seq 0 $((`jq -r '.sources | length' "$mapfile"`-1)) | while read n | |
do | |
file="$(jq -r ".sources[$n]" "$mapfile")" | |
dir="$(dirname "$file")" | |
mkdir -p "$dir" | |
jq -r ".sourcesContent[$n]" "$mapfile" > "$file" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment