Skip to content

Commit 2fbf3ae

Browse files
committed
Sync browser manifest version with editor package version during build
- once browser extension is built by install scripts, set the same version in `apps/browser/out/manifest.json` as in `apps/editor/package.json`
1 parent 8a159d1 commit 2fbf3ae

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎install.ps1‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,8 @@ Remove-Item "apps/editor/*.vsix" -Force -ErrorAction SilentlyContinue
559559
$null = Invoke-Step "$msg_step_build..." {
560560
pnpm --filter gemini-coder --filter browser build *>$null
561561
if ($LASTEXITCODE -ne 0) { throw "pnpm build failed" }
562+
node -e "const fs = require('fs'); const version = JSON.parse(fs.readFileSync('apps/editor/package.json', 'utf8')).version; const manifestPath = 'apps/browser/out/manifest.json'; const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8')); manifest.version = version; fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + '\n');" *>$null
563+
if ($LASTEXITCODE -ne 0) { throw "Failed to update browser manifest version" }
562564
} $msg_step_build
563565

564566
Set-Location apps/editor

‎install.sh‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,9 +598,14 @@ if ! run_step "$msg_step_deps" pnpm --filter gemini-coder --filter browser insta
598598
fi
599599
fi
600600

601+
build_extension() {
602+
pnpm --filter gemini-coder --filter browser build && \
603+
node -e "const fs = require('fs'); const version = JSON.parse(fs.readFileSync('apps/editor/package.json', 'utf8')).version; const manifestPath = 'apps/browser/out/manifest.json'; const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8')); manifest.version = version; fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + '\n');"
604+
}
605+
601606
rm -f ./apps/editor/*.vsix
602607

603-
run_step "$msg_step_build" pnpm --filter gemini-coder --filter browser build
608+
run_step "$msg_step_build" build_extension
604609

605610
cd apps/editor
606611

0 commit comments

Comments
 (0)