blob: 17600185baa85cad0cf3e0ca4e4c98b80d7f39ce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#!/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')
echo "============================="
timestamp=$(echo "${file}" | cut -d'-' -f1)
matching_file=$(find "${org_path}" -name "${timestamp}-*.org" -type f)
if [[ -f "${matching_file}" ]]; then
cp -p "${matching_file}" "notes/${id}"
fi
done
|