-
Notifications
You must be signed in to change notification settings - Fork 489
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
[Merged by Bors] - fix: replace fvm
binary on fvm self install
#3616
[Merged by Bors] - fix: replace fvm
binary on fvm self install
#3616
Conversation
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.
LGTM, good to add a test for it
d09f5cb
to
752165f
Compare
// Creates the binaries directory | ||
let bin_dir = fvm_dir.join("bin"); | ||
create_dir_all(bin_dir)?; |
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.
Instead of checking for directories before creating:
if !fvm_dir.exists() {
create_dir(&fvm_dir)?;
tracing::debug!(?fvm_dir, "Created FVM home directory with success");
}
We can use create_dir_all
which not only create parent dirs in a single execution
but it also allows for no-op on already existent dirs.
Settings::init()?; | ||
|
||
Settings::open()?; |
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.
Settings::init
creates the Settings
file if it doesnt exists, instead Settings::open
will attempt to open the settings.toml
file, but if it doesnt
exists it creates it (using Settings::init
).
ad134bd
to
03677a1
Compare
03677a1
to
1ae5b8f
Compare
bors r+ |
Ensures the FVM binary is replaced when running `fvm self install` The approach involves making sure FVM where `self install` is executed is not the same as `fvm` which is already installed. Otherwise `bus` errors will occur by trying to replace the ongoing process binary.
Build failed: |
bors r+ |
Ensures the FVM binary is replaced when running `fvm self install` The approach involves making sure FVM where `self install` is executed is not the same as `fvm` which is already installed. Otherwise `bus` errors will occur by trying to replace the ongoing process binary.
Pull request successfully merged into master. Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
fvm
binary on fvm self install
fvm
binary on fvm self install
Ensures the FVM binary is replaced when running
fvm self install
The approach involves making sure FVM where
self install
is executed is notthe same as
fvm
which is already installed. Otherwisebus
errors will occur bytrying to replace the ongoing process binary.