aboutsummaryrefslogtreecommitdiffstats
path: root/start-dev.sh
diff options
context:
space:
mode:
authorxuatz <xzlow10@gmail.com>2025-07-17 17:24:33 +0900
committerGitHub <noreply@github.com>2025-07-17 09:24:33 +0100
commitfe69ca8ce88b51b0117aebfbb512fef16b4ebb35 (patch)
tree32b8e96940b8a9de1ffe433347f95f33a47a8614 /start-dev.sh
parenta3627569466677d3c0f585af3e04b7ce7a14249f (diff)
downloadkarakeep-fe69ca8ce88b51b0117aebfbb512fef16b4ebb35.tar.zst
feat(mobile): Add user setting for default bookmark view mode (#1723)
* feat(mobile): add user setting for default bookmark view mode * regen db migration script * clean up implementation * Update docs/docs/07-Development/01-setup.md * Update GEMINI.md * use local setting instead of storing value in db * improve start-dev.sh to also handle for db migration * rename mobileBookmarkClickDefaultViewMode to defaultBookmarkView for consistency
Diffstat (limited to '')
-rwxr-xr-xstart-dev.sh28
1 files changed, 26 insertions, 2 deletions
diff --git a/start-dev.sh b/start-dev.sh
index a421be34..0f5f9d2e 100755
--- a/start-dev.sh
+++ b/start-dev.sh
@@ -50,9 +50,33 @@ if [ ! -d "node_modules" ]; then
pnpm install
fi
-# Start the web app and workers in parallel
-echo "Starting web app and workers..."
+# Get DATA_DIR from environment or .env file
+if [ -z "$DATA_DIR" ] && [ -f ".env" ]; then
+ DATA_DIR=$(grep "^DATA_DIR=" .env | cut -d'=' -f2)
+fi
+
+# Create DATA_DIR if it doesn't exist
+if [ -n "$DATA_DIR" ] && [ ! -d "$DATA_DIR" ]; then
+ echo "Creating DATA_DIR at $DATA_DIR..."
+ mkdir -p "$DATA_DIR"
+fi
+
+# Start the web app
+echo "Starting web app..."
pnpm web & WEB_PID=$!
+
+# Wait for web app to be ready
+echo "Waiting for web app to start..."
+until curl -s http://localhost:3000 > /dev/null 2>&1; do
+ sleep 1
+done
+
+# Run database migrations
+echo "Running database migrations..."
+pnpm run db:migrate
+
+# Start workers
+echo "Starting workers..."
pnpm workers & WORKERS_PID=$!
# Function to handle script termination