-
Notifications
You must be signed in to change notification settings - Fork 143
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
Add bun sudo option? bun doesnt upgrade without it if installed on /usr/bin(from aur) #892
Comments
dude wat?! dont download it guys. kinda sketchy |
is that comment a spam comment🤔 |
$ bun upgrade |
ye and if its installed on /usr/bin then that would need SU to update |
I think Topgrade should only invoke the install_env=BUN_INSTALL
bin_env=\$$install_env/bin
install_dir=${!install_env:-$HOME/.bun}
bin_dir=$install_dir/bin
exe=$bin_dir/bun And it looks the Windows script ( $BunRoot = if ($env:BUN_INSTALL) { $env:BUN_INSTALL } else { "${Home}\.bun" }
$BunBin = mkdir -Force "${BunRoot}\bin" Let me give this a fix. |
Pretty fair. But if it just add the use_sudo option. both will work. just user that got it installed on /usr/bin need to edit the configuration. |
We should avoid this if possible as unexpected conflicts may happen. #894 should fix this issue. |
Here is a build for Linux, welcome to give it a test. |
Gentle ping again. |
Please do not do this, bun should only be upgraded from the method used to install, i.e. package manager if AUR. Thanks for the PR, I'm not OP but I'll try to give this a go today. |
Hi again, I'm currently on a machine with bun with official install script, and it's not working. I don't know rust but looking at the code it seems to check for ~/.bun? This might be tricky, as I've changed the install dir to |
That is the default installation path, one can customize it via the environment variable
Did you do it through that env var? |
BTW, mind giving me the output of: $ topgrade --only bun --verbose |
I did use the var, but only passed it to bash during installation. I've now exported the var in my shell profile and it's working! I can only test the aur install when I'm on my arch machine later today, but judging from the behavior, it should work as expected, i.e. not try to upgrade. Thanks Steve. Update: for the output you asked, sorry no, because I'm on a business machine with restricted access. I'm typing from my phone. I do however see: Step bun Executing command ..bun upgrade If I unset the var, it says Bun not installed through the official script, skipping.. Sorry for the formatting. |
Wait,
Thanks for the manually typed output, it still helps a lot! |
Yes it does, because, and this is only my assumption, it doesn't care about the env var, it knows where it's located from the binary itself. Even if you were to move it to /tmp and run it from there it would still work. Maybe you could check install dir, i.e /usr/* vs ~/* but of course this is unreliable, as a user might have chosen to manually install to something like .usr.local.bin |
Yeah, that is also my guess.
Perhaps I should file an issue in the Bun repo to seek some help. |
filed: oven-sh/bun#13605 |
Thanks. FWIW, I tested it on my arch system and it's working.
|
Thanks for testing it! |
Erroneous Behavior
bun upgrade not working
Expected Behavior
bun upgraded
Steps to reproduce
install
bun-bin
from the aur then use topgrade 2 updatePossible Cause (Optional)
no sudo access
Problem persists without calling from topgrade
Did you run topgrade through
Remote Execution
If yes, does the issue still occur when you run topgrade directlly in your
remote host
Configuration file (Optional)
YES WE NEED 2 ADD A use_sudo like npm
Additional Details
Arch Rolling release
AUR
topgrade -V
)Topgrade 14.0.1
Verbose Output (
topgrade -v
)doesnt matter
The text was updated successfully, but these errors were encountered: