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

Commit

Permalink
Change install::install to install
Browse files Browse the repository at this point in the history
  • Loading branch information
EverlastingBugstopper committed Nov 7, 2019
1 parent d70cad2 commit 4b916ba
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/commands/build/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ pub mod wranglerjs;
mod watch;
pub use watch::watch_and_build;

use crate::commands;
use crate::install::install;
use crate::settings::target::{Target, TargetType};
use crate::terminal::message;
use crate::{commands, install};

use std::path::PathBuf;
use std::process::Command;
Expand All @@ -18,7 +19,7 @@ pub fn build(target: &Target) -> Result<(), failure::Error> {
}
TargetType::Rust => {
let tool_name = "wasm-pack";
let binary_path = install::install(tool_name, "rustwasm")?.binary(tool_name)?;
let binary_path = install(tool_name, "rustwasm")?.binary(tool_name)?;
let args = ["build", "--target", "no-modules"];

let command = command(&args, &binary_path);
Expand Down
5 changes: 3 additions & 2 deletions src/commands/build/watch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ use ignore::overrides::OverrideBuilder;
use ignore::WalkBuilder;
pub use watcher::wait_for_changes;

use crate::commands;
use crate::commands::build::{command, wranglerjs};
use crate::install::install;
use crate::settings::target::{Target, TargetType};
use crate::terminal::message;
use crate::{commands, install};

use notify::{self, RecursiveMode, Watcher};
use std::sync::mpsc;
Expand Down Expand Up @@ -52,7 +53,7 @@ pub fn watch_and_build(
}
TargetType::Rust => {
let tool_name = "wasm-pack";
let binary_path = install::install(tool_name, "rustwasm")?.binary(tool_name)?;
let binary_path = install(tool_name, "rustwasm")?.binary(tool_name)?;
let args = ["build", "--target", "no-modules"];

thread::spawn(move || {
Expand Down
5 changes: 3 additions & 2 deletions src/commands/build/wranglerjs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::commands::generate::run_generate;

use crate::commands::publish::package::Package;
use crate::install;
use crate::install::{install, install_artifact};
use crate::util;
pub use bundle::Bundle;
use fs2::FileExt;
Expand Down Expand Up @@ -162,7 +163,7 @@ fn setup_build(target: &Target) -> Result<(Command, PathBuf, Bundle), failure::E
// https://github.com/wasm-tool/wasm-pack-plugin/blob/caca20df84782223f002735a8a2e99b2291f957c/plugin.js#L13
let tool_name = "wasm-pack";
let author = "rustwasm";
let wasm_pack_path = install::install(tool_name, author)?.binary(tool_name)?;
let wasm_pack_path = install(tool_name, author)?.binary(tool_name)?;
command.env("WASM_PACK_PATH", wasm_pack_path);
}

Expand Down Expand Up @@ -324,7 +325,7 @@ fn install_wranglerjs() -> Result<PathBuf, failure::Error> {
let tool_name = "wranglerjs";
let author = "cloudflare";
let version = env!("CARGO_PKG_VERSION");
let wranglerjs_path = install::install_artifact(tool_name, author, version)?;
let wranglerjs_path = install_artifact(tool_name, author, version)?;
info!("wranglerjs downloaded at: {:?}", wranglerjs_path.path());
wranglerjs_path.path()
};
Expand Down
5 changes: 3 additions & 2 deletions src/commands/generate/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use std::path::PathBuf;
use std::process::Command;

use crate::commands;
use crate::commands::validate_worker_name;
use crate::install::install;
use crate::settings::target::{Manifest, Site, TargetType};
use crate::{commands, install};

pub fn generate(
name: &str,
Expand All @@ -28,7 +29,7 @@ pub fn generate(

pub fn run_generate(name: &str, template: &str) -> Result<(), failure::Error> {
let tool_name = "cargo-generate";
let binary_path = install::install(tool_name, "ashleygwilliams")?.binary(tool_name)?;
let binary_path = install(tool_name, "ashleygwilliams")?.binary(tool_name)?;

let args = ["generate", "--git", template, "--name", name, "--force"];

Expand Down

0 comments on commit 4b916ba

Please sign in to comment.