Skip to content

Instantly share code, notes, and snippets.

@grahamc
Created April 25, 2021 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grahamc/7642aaadda5ced58bf406e05b769d5c1 to your computer and use it in GitHub Desktop.
Save grahamc/7642aaadda5ced58bf406e05b769d5c1 to your computer and use it in GitHub Desktop.
#!/bin/bash
declare -a left
jq -cMr '.contents[] | [.object, .symlink][]' < .attrs.json >&4
while read -r obj <&4 && read -r sym <&4; 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