Skip to content

Commit

Permalink
Create local shell
Browse files Browse the repository at this point in the history
  • Loading branch information
ikoamu committed Jun 14, 2024
1 parent f55aa76 commit ade27a2
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ DS_Store
graphdata.json
searchdata.json
notes/
org-roam-ui/
out/
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ runs:
shell: bash
- name: Generate graphdata.json
working-directory: action
run: npm run generate --script_params='../orgs/${{ inputs.org-roam-directory }}/${{ inputs.org-roam-db-filename }}'
run: npm run generate:graphdata --script_params='../orgs/${{ inputs.org-roam-directory }}/${{ inputs.org-roam-db-filename }}'
shell: bash
- name: Create Notes
working-directory: action
Expand Down
1 change: 1 addition & 0 deletions generate_json.js → generate_graphdata.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
console.log("db file", process.argv[2]);

const sqlite3 = require('sqlite3').verbose();
const dbFile = process.argv[2];
const db = new sqlite3.Database(dbFile);
Expand Down
31 changes: 31 additions & 0 deletions local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

ROAM_PATH='/Users/aokisusumutarou/zettelkasten'
ROAM_DB_FILE='org-roam.db'
ROAM_DB_PATH=$ROAM_PATH/$ROAM_DB_FILE
ROAM_IMG_PATH=$ROAM_PATH/img

# # If org-roam-ui directory does not exists, clone the org-roam-ui repository.
# if [ ! -d "org-roam-ui" ]; then
# git clone -b publish-org-roam-ui https://github.com/ikoamu/org-roam-ui
# fi

# # Generate data for org-roam-ui
# npm install
# npm run generate:graphdata --script_params=$ROAM_DB_PATH
# ./create_notes.sh $ROAM_PATH
# npm run generate:search

# Copy files to the org-roam-ui directory
cp -f searchdata.json org-roam-ui/components/Search/
if [ -d $ROAM_IMG_PATH ]; then
cp -r $ROAM_IMG_PATH org-roam-ui/public
fi

pushd org-roam-ui
yarn install
pushd standalone
./build-standalone-server.sh ../..
mv out ../../
popd
popd
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "1.0.0",
"description": "",
"scripts": {
"generate": "node ./generate_json.js $npm_config_script_params",
"generate:graphdata": "node ./generate_graphdata.js $npm_config_script_params",
"generate:search": "node ./generate_searchdata.mjs"
},
"keywords": [],
Expand Down

0 comments on commit ade27a2

Please sign in to comment.