Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Check if rustc exists before building a Rust project type #1461

Merged
merged 2 commits into from
Jul 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/build/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::settings::toml::{Target, TargetType};
use crate::terminal::message;
use crate::terminal::{message, styles};
use crate::wranglerjs;
use crate::{commands, install};

Expand All @@ -13,6 +13,14 @@ pub fn build(target: &Target) -> Result<(), failure::Error> {
message::info("JavaScript project found. Skipping unnecessary build!")
}
TargetType::Rust => {
let _ = which::which("rustc").map_err(|e| {
failure::format_err!(
"'rustc' not found: {}. Installation documentation can be found here: {}",
e,
styles::url("https://www.rust-lang.org/tools/install")
)
})?;

let binary_path = install::install_wasm_pack()?;
let args = ["build", "--target", "no-modules"];

Expand Down