Skip to content

Commit

Permalink
chore: rename build_command module to build
Browse files Browse the repository at this point in the history
  • Loading branch information
dj8yf0μl committed Dec 3, 2024
1 parent 6e44f83 commit 0f3f053
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,3 @@ pub struct Command {
#[interactive_clap(subcommand)]
actions: actions::Actions,
}

// fn get_env_key_vals(input: Vec<String>) -> Vec<(String, String)> {
// let iterator = input.iter().flat_map(|pair_string| {
// pair_string
// .split_once('=')
// .map(|(env_key, value)| (env_key.to_string(), value.to_string()))
// });

// let dedup_map: HashMap<String, String> = HashMap::from_iter(iterator);

// let result = dedup_map.into_iter().collect();
// tracing::info!(
// target: "near_teach_me",
// parent: &tracing::Span::none(),
// "Passed additional environment pairs:\n{}",
// near_cli_rs::common::indent_payload(&format!("{:#?}", result))
// );
// result
// }
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use near_cli_rs::commands::contract::deploy::initialize_mode::InitializeMode;

use crate::commands::build_command;
use crate::commands::build as build_command;

#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = near_cli_rs::GlobalContext)]
Expand All @@ -18,7 +18,7 @@ pub struct DeployOpts {
}

mod context {
use crate::commands::build_command;
use crate::commands::build as build_command;

#[derive(Debug, Clone)]
pub struct Context(near_cli_rs::commands::contract::deploy::ContractFileContext);
Expand Down Expand Up @@ -69,7 +69,7 @@ mod manual_input {
/// this module is needed because of #[interactive_clap(skip_default_from_cli)]
/// on `Opts`
mod manual_from_cli {
use crate::commands::build_command;
use crate::commands::build as build_command;
use near_cli_rs::commands::contract::deploy::initialize_mode::InitializeMode;

impl interactive_clap::FromCli for super::DeployOpts {
Expand Down
6 changes: 3 additions & 3 deletions cargo-near/src/commands/deploy/actions/reproducible_wasm.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use near_cli_rs::commands::contract::deploy::initialize_mode::InitializeMode;

use crate::commands::build_command;
use crate::commands::build as build_command;

#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
#[interactive_clap(input_context = near_cli_rs::GlobalContext)]
Expand All @@ -21,7 +21,7 @@ pub struct DeployOpts {
}

mod context {
use crate::commands::build_command;
use crate::commands::build as build_command;

#[derive(Debug, Clone)]
pub struct Context(near_cli_rs::commands::contract::deploy::ContractFileContext);
Expand Down Expand Up @@ -75,7 +75,7 @@ mod manual_input {
/// this module is needed because of #[interactive_clap(skip_default_from_cli)]
/// on `Opts`
mod manual_from_cli {
use crate::commands::build_command;
use crate::commands::build as build_command;
use near_cli_rs::commands::contract::deploy::initialize_mode::InitializeMode;

impl interactive_clap::FromCli for super::DeployOpts {
Expand Down
4 changes: 2 additions & 2 deletions cargo-near/src/commands/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use strum::{EnumDiscriminants, EnumIter, EnumMessage};

pub mod abi_command;
pub mod build_command;
pub mod build;
pub mod create_dev_account;
pub mod deploy;
pub mod new;
Expand All @@ -22,7 +22,7 @@ pub enum NearCommand {
message = "build - Build a NEAR contract with embedded ABI"
))]
/// Build a NEAR contract with embedded ABI
Build(self::build_command::Command),
Build(self::build::Command),
#[strum_discriminants(strum(
message = "abi - Generates ABI for the contract"
))]
Expand Down
4 changes: 2 additions & 2 deletions cargo-near/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::env;
use std::io::IsTerminal;
use std::{env, ops::Index};

use cargo_near_build::env_keys;
use colored::Colorize;
Expand All @@ -11,7 +11,7 @@ use cargo_near::{setup_tracing, CliOpts, Cmd, Opts};

fn main() -> CliResult {
let args = std::env::args().collect::<Vec<_>>();
if std::env::var(env_keys::nep330::BUILD_ENVIRONMENT).is_ok() {
if env::var(env_keys::nep330::BUILD_ENVIRONMENT).is_ok() {
println!("enforcing stuff in docker");
if args.len() < 4 {
return Err(color_eyre::eyre::eyre!("it's not cool in docker"));
Expand Down

0 comments on commit 0f3f053

Please sign in to comment.