Repository navigation
fix: use global bun paperclipai with pino override #1353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -49,4 +49,17 @@ if [ -n "$DEPS" ]; then | |||||||||||||||||||||||||||
| bun install --global $DEPS 2>/dev/null || true | ||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # Apply dependency overrides to the global install | ||||||||||||||||||||||||||||
| # Bun's flat hoisting can resolve incompatible versions (e.g. pino@10 vs pino-http@10.5) | ||||||||||||||||||||||||||||
| OVERRIDES=$(jq -c '.overrides // empty' "$PACKAGE_JSON" 2>/dev/null || true) | ||||||||||||||||||||||||||||
| if [ -n "$OVERRIDES" ]; then | ||||||||||||||||||||||||||||
| GLOBAL_PKG="${HOME}/.bun/install/global/package.json" | ||||||||||||||||||||||||||||
| if [ -f "$GLOBAL_PKG" ]; then | ||||||||||||||||||||||||||||
| jq --argjson overrides "$OVERRIDES" '.overrides = $overrides' "$GLOBAL_PKG" >"${GLOBAL_PKG}.tmp" && | ||||||||||||||||||||||||||||
| mv "${GLOBAL_PKG}.tmp" "$GLOBAL_PKG" | ||||||||||||||||||||||||||||
|
Comment on lines
+58
to
+59
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The jq and mv commands should handle failures gracefully to remain consistent with the error handling pattern used elsewhere in this script. This ensures that a failure in patching the global package.json (due to permissions or an invalid global manifest) does not halt the entire home-manager activation process.
Suggested change
References
Comment on lines
+58
to
+59
|
||||||||||||||||||||||||||||
| (cd "${HOME}/.bun/install/global" && bun install 2>/dev/null || true) | ||||||||||||||||||||||||||||
| echo "Applied dependency overrides to global install" | ||||||||||||||||||||||||||||
|
Comment on lines
+58
to
+61
|
||||||||||||||||||||||||||||
| jq --argjson overrides "$OVERRIDES" '.overrides = $overrides' "$GLOBAL_PKG" >"${GLOBAL_PKG}.tmp" && | |
| mv "${GLOBAL_PKG}.tmp" "$GLOBAL_PKG" | |
| (cd "${HOME}/.bun/install/global" && bun install 2>/dev/null || true) | |
| echo "Applied dependency overrides to global install" | |
| GLOBAL_PKG_TMP="${GLOBAL_PKG}.tmp" | |
| if jq --argjson overrides "$OVERRIDES" '.overrides = $overrides' "$GLOBAL_PKG" >"$GLOBAL_PKG_TMP" && | |
| mv "$GLOBAL_PKG_TMP" "$GLOBAL_PKG"; then | |
| (cd "${HOME}/.bun/install/global" && bun install 2>/dev/null || true) | |
| echo "Applied dependency overrides to global install" | |
| else | |
| rm -f "$GLOBAL_PKG_TMP" | |
| echo "Warning: failed to apply dependency overrides to global install, continuing" | |
| fi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,7 +26,7 @@ lib.mkIf host.isKyber { | |
| }; | ||
| Service = { | ||
| Type = "simple"; | ||
| ExecStart = "${homeDir}/dotfiles/node_modules/.bin/paperclipai run --no-repair"; | ||
| ExecStart = "${homeDir}/.bun/bin/paperclipai run --no-repair"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| Restart = "always"; | ||
| RestartSec = "5s"; | ||
| Environment = [ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: The new jq expression overwrites existing global
overridesinstead of merging, which can silently drop previously configured override rules.Prompt for AI agents