diff options
author | ikoamu <ikoamu@gmail.com> | 2024-01-24 21:27:40 +0900 |
---|---|---|
committer | ikoamu <ikoamu@gmail.com> | 2024-01-24 21:27:40 +0900 |
commit | aef1376d811faebdef4969e38f7330e176091f57 (patch) | |
tree | 938d810cde0747f43d2d9116ce26a9491610e4ec | |
parent | dc83e40efe39932b17ccf7ef74fdca5ed127c1e3 (diff) |
Add graphdata generation and note creation scripts
-rw-r--r-- | action.yml | 26 | ||||
-rw-r--r-- | generate_json.js (renamed from generateJson.js) | 0 | ||||
-rwxr-xr-x | generate_notes.sh | 11 | ||||
-rw-r--r-- | package.json | 2 |
4 files changed, 27 insertions, 12 deletions
@@ -27,18 +27,22 @@ runs: with: node-version: "20.x" - - name: print files - run: ls -la + - name: Install graphdata generator dependencies + working-directory: action + run: npm install shell: bash - # - name: Install dependencies - # run: npm install - # shell: bash + - name: Generate graphdata.json + working-directory: action + run: npm run generate --script_params=../orgs/org-roam.db + shell: bash - # - name: Generate graphdata.json - # run: npm run generate --script_params=./orgs/org-roam.db - # shell: bash + - name: Create Notes + working-directory: action + run: ./create_notes.sh + shell: bash - # - name: print graphdata.json - # run: cat graphdata.json - # shell: bash + - name: print files + run: ls -la + working-directory: action + shell: bash diff --git a/generateJson.js b/generate_json.js index be51cf0..be51cf0 100644 --- a/generateJson.js +++ b/generate_json.js diff --git a/generate_notes.sh b/generate_notes.sh new file mode 100755 index 0000000..05c727a --- /dev/null +++ b/generate_notes.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +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') + cp -p "${file}" "notes/${id}" +done
\ No newline at end of file diff --git a/package.json b/package.json index 31ca4a0..7a52956 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "", "scripts": { - "generate": "node ./generateJson.js $npm_config_script_params" + "generate": "node ./generate_json.js $npm_config_script_params" }, "keywords": [], "author": "", |