Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
fix: Handle sync_manifest failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Oct 2, 2023
1 parent 44fc8c5 commit 39e4df5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#### 🐞 Fixes

- Will now respect the `RUSTUP_HOME` environment variable when locating the `.rustup` store.
- Fixed an issue where `sync_manifest` would fail if we didn't have read access to the rustup store.

#### ⚙️ Internal

Expand Down
7 changes: 6 additions & 1 deletion src/proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,12 @@ pub fn sync_manifest(Json(_): Json<SyncManifestInput>) -> FnResult<Json<SyncMani
let mut output = SyncManifestOutput::default();
let mut versions = vec![];

for dir in fs::read_dir(get_rustup_home(&env)?.join("toolchains"))? {
// Path may not be whitelisted, so exit early instead of failing
let Ok(dirs) = fs::read_dir(get_rustup_home(&env)?.join("toolchains")) else {
return Ok(Json(output));
};

for dir in dirs {
let dir = dir?.path();

if !dir.is_dir() {
Expand Down

0 comments on commit 39e4df5

Please sign in to comment.