fix(update): discard local package-lock.json before git pull, bump v0.4.9
npm install modifies package-lock.json on the server, causing 'git pull --ff-only' to abort with 'your local changes would be overwritten'. Add 'git checkout -- package-lock.json' before the pull so the generated lock file never blocks updates.
This commit is contained in:
@@ -6,6 +6,13 @@ Pre-1.0 versions treat MINOR as feature releases and PATCH as bug fixes.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## [0.4.9] — 2026-04-11
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
- **`update.sh` fails when `package-lock.json` has local changes** — `git pull --ff-only` aborted with "Your local changes would be overwritten by merge" whenever npm had modified the lock file on the server. Fixed by running `git checkout -- package-lock.json` before the pull to discard local changes to the generated lock file.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## [0.4.8] — 2026-04-11
|
## [0.4.8] — 2026-04-11
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "nixpanel-server",
|
"name": "nixpanel-server",
|
||||||
"version": "0.4.8",
|
"version": "0.4.9",
|
||||||
"private": true,
|
"private": true,
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"server",
|
"server",
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ INSTALL_DIR="${1:-/opt/nixpanel}"
|
|||||||
[[ -d "$INSTALL_DIR/.git" ]] || error "NixPanel not found at $INSTALL_DIR"
|
[[ -d "$INSTALL_DIR/.git" ]] || error "NixPanel not found at $INSTALL_DIR"
|
||||||
|
|
||||||
step "Pulling latest code"
|
step "Pulling latest code"
|
||||||
|
# Discard any local changes to generated/lock files so git pull never conflicts
|
||||||
|
git -C "$INSTALL_DIR" checkout -- package-lock.json 2>/dev/null || true
|
||||||
git -C "$INSTALL_DIR" pull --ff-only
|
git -C "$INSTALL_DIR" pull --ff-only
|
||||||
success "Code updated"
|
success "Code updated"
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -73,7 +73,7 @@ export async function buildApp() {
|
|||||||
|
|
||||||
fastify.get('/api/health', async () => ({
|
fastify.get('/api/health', async () => ({
|
||||||
status: 'ok',
|
status: 'ok',
|
||||||
version: '0.4.8',
|
version: '0.4.9',
|
||||||
timestamp: new Date().toISOString(),
|
timestamp: new Date().toISOString(),
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user