Skip to content

Commit

Permalink
Refactor create_notes.sh script to copy files based on graphdata.json
Browse files Browse the repository at this point in the history
  • Loading branch information
ikoamu committed Jan 27, 2024
1 parent 38da706 commit 0246f6b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions create_notes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@ orgPath=$1

mkdir -p notes

cat graphdata.json
# cat graphdata.json

ls -ls "${orgPath}"
# ls -ls "${orgPath}"

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 "============================="
echo "id: ${id}"
echo "file: ${file}"
cat "${orgPath}/${file}"

cp -p "${orgPath}/${file}" "notes/${id}"
done

0 comments on commit 0246f6b

Please sign in to comment.