Skip to content

Commit f5becb4

Browse files
Mohataseem89Lms24
andauthored
chore(bun): Fix install-bun.js version check and improve upgrade feedback (#18492)
1. fixed incorrect Bun version command 2. removed unused variable 3. improved user feedback(logs a clear message when Bun is already on the latest version instead of silently exiting) --------- Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>
1 parent 1b618fc commit f5becb4

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

packages/bun/scripts/install-bun.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ const https = require('https');
1010
const installScriptUrl = 'https://bun.sh/install';
1111

1212
// Check if bun is installed
13-
exec('bun -version', (error, version) => {
13+
exec('bun --version', (error, version) => {
1414
if (error) {
1515
console.error('bun is not installed. Installing...');
1616
installLatestBun();
1717
} else {
18-
const versionBefore = version.trim();
19-
2018
exec('bun upgrade', (error, stdout, stderr) => {
2119
if (error) {
2220
console.error('Failed to upgrade bun:', error);
@@ -26,6 +24,7 @@ exec('bun -version', (error, version) => {
2624
const out = [stdout, stderr].join('\n');
2725

2826
if (out.includes("You're already on the latest version of Bun")) {
27+
console.log('Bun is already up to date.');
2928
return;
3029
}
3130

0 commit comments

Comments
 (0)