aboutsummaryrefslogtreecommitdiff
path: root/create_notes.sh
blob: 452230eeeba9562787e51bd2aae26dcec68cd54b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

org_path=$1

mkdir -p notes

cat graphdata.json |
jq -c '.data.nodes[]' |
while read -r nodes; do
  id=$(echo "${nodes}" | jq -r '.id')
  file=$(echo "${nodes}" | jq -r '.file') 
  matching_file=$(find "${org_path}" -name "${file}" -type f)
  
  if [[ -f "${matching_file}" ]]; then
    cp -p "${matching_file}" "notes/${id}"
  fi
done