aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--action.yml26
-rw-r--r--generate_json.js (renamed from generateJson.js)0
-rwxr-xr-xgenerate_notes.sh11
-rw-r--r--package.json2
4 files changed, 27 insertions, 12 deletions
diff --git a/action.yml b/action.yml
index 027a0e6..ae2049a 100644
--- a/action.yml
+++ b/action.yml
@@ -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": "",