Skip to content

Commit 22931a2

Browse files
committed
feat: add pb dev script
1 parent 9ec508f commit 22931a2

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

.env.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
POCKETBASE_URL=""
1+
POCKETBASE_URL="http://127.0.0.1:8090"

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"scripts": {
1414
"postinstall": "svelte-kit sync",
1515
"dev": "vite dev",
16+
"dev:pb": "./pocketbase/dev.sh",
1617
"build": "vite build",
1718
"preview": "vite preview",
1819
"lint": "prettier --check src && pnpm check",
@@ -59,4 +60,4 @@
5960
"node": "22.9.0",
6061
"pnpm": "9.12.0"
6162
}
62-
}
63+
}

pocketbase/dev.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
if [[ ${PWD##*/} != "pocketbae" ]]; then
2+
cd pocketbase || exit 1
3+
fi
4+
5+
echo "Applying migrations..."
6+
go run main.go migrate up
7+
echo "Adding admin user..."
8+
go run main.go admin create [email protected] testtest &>/dev/null
9+
echo "Starting..."
10+
go run main.go serve

0 commit comments

Comments
 (0)