Created
April 25, 2021 20:17
-
-
Save grahamc/b572fbae1782b512bec3b17b55b9c768 to your computer and use it in GitHub Desktop.
This file contains 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/bash | |
jq -cMr '.contents[] | [.object, .symlink][]' < .attrs.json \ | |
| ( | |
declare -a left | |
while read -r obj && read -r sym; do | |
if [ "$sym" != null ]; then | |
mkdir -p "root/$(dirname "$sym")" | |
ln -s "$obj" "root/$sym" | |
fi | |
left+=("$obj") | |
echo ''${#left[@]} | |
done | |
echo ''${#left[@]} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment