Skip to content

fix: 'text file is busy' error when updating on linux#7

Open
unaimeds wants to merge 2 commits intopolarsource:mainfrom
unaimeds:main
Open

fix: 'text file is busy' error when updating on linux#7
unaimeds wants to merge 2 commits intopolarsource:mainfrom
unaimeds:main

Conversation

@unaimeds
Copy link
Copy Markdown

When using the polar update command on Linux (tested on Arch Linux x86_64) an error is thrown:

[13:36:55.502] ERROR (#16):
  Error: Failed to replace binary: ETXTBSY: text file is busy, open '/usr/local/bin/polar'
    at catch (/$bunfs/root/polar:83255:30)

because it's trying to replace the same file from which we've ran the update command.

I updated the code to first write the new binary to a temp file then rename the temp file to target binary path.
Also if the update is ran in directory that's not owned by user an access error will be thrown, it should be now handled and file rename will be re-ran as sudo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant