Skip to content

Commit

Permalink
fix: Move the schema loading around.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Dec 1, 2023
1 parent 61a0a91 commit 6479580
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
- [Rust](https://github.com/moonrepo/rust-plugin/blob/master/CHANGELOG.md)
- [TOML schema](https://github.com/moonrepo/schema-plugin/blob/master/CHANGELOG.md)

## Unreleased

#### 🐞 Fixes

- Actually fixed `proto use` this time.

## 0.23.6

#### 🚀 Updates
Expand Down
7 changes: 0 additions & 7 deletions crates/cli/src/commands/install_all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use crate::{
commands::install::{internal_install, InstallArgs},
};
use miette::IntoDiagnostic;
use proto_core::load_schema_plugin;
use starbase::system;
use starbase_styles::color;
use std::{env, process};
Expand Down Expand Up @@ -54,12 +53,6 @@ pub async fn install_all() {

disable_progress_bars();

// Download the schema plugin before installing tools.
// We must do this here, otherwise when multiple schema
// based tools are installed in parallel, they will
// collide when attempting to download the schema plugin!
load_schema_plugin(&loader.proto, &loader.user_config).await?;

// Then install each tool in parallel!
let mut futures = vec![];

Expand Down
10 changes: 8 additions & 2 deletions crates/cli/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use futures::StreamExt;
use indicatif::{ProgressBar, ProgressStyle};
use miette::IntoDiagnostic;
use proto_core::{
get_temp_dir, load_tool_from_locator, Id, ProtoEnvironment, ProtoError, Tool, ToolsConfig,
UserConfig, SCHEMA_PLUGIN_KEY,
get_temp_dir, load_schema_plugin, load_tool_from_locator, Id, ProtoEnvironment, ProtoError,
Tool, ToolsConfig, UserConfig, SCHEMA_PLUGIN_KEY,
};
use starbase_utils::fs;
use std::cmp;
Expand Down Expand Up @@ -128,6 +128,12 @@ impl ToolsLoader {
plugins.extend(&self.user_config.plugins);
plugins.extend(&self.tools_config.plugins);

// Download the schema plugin before loading plugins.
// We must do this here, otherwise when multiple schema
// based tools are installed in parallel, they will
// collide when attempting to download the schema plugin!
load_schema_plugin(&self.proto, &self.user_config).await?;

let mut futures = vec![];
let mut tools = vec![];

Expand Down

0 comments on commit 6479580

Please sign in to comment.