aboutsummaryrefslogtreecommitdiff
path: root/local.sh
diff options
context:
space:
mode:
authorikoamu <ikoamu@gmail.com>2024-06-14 19:40:22 +0900
committerikoamu <ikoamu@gmail.com>2024-06-14 19:50:54 +0900
commit716927681898fa154487ffe962f629d7f9483e1b (patch)
treefcddff04aaf9db2c5b6f671d6e367ebc6d4c4e95 /local.sh
parentf55aa766f1e97417001ba1d1485b13162d2919f2 (diff)
Create local shell
Diffstat (limited to 'local.sh')
-rwxr-xr-xlocal.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/local.sh b/local.sh
new file mode 100755
index 0000000..c27632b
--- /dev/null
+++ b/local.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+read -p "Enter the ROAM_PATH: " ROAM_PATH
+read -p "Enter the ROAM_DB_FILE: " ROAM_DB_FILE
+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 \ No newline at end of file