Skip to content

Commit

Permalink
Fixing CI errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ndkazu committed Jan 1, 2025
1 parent b4af4fd commit 4b19b40
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion crates/pop-cli/src/commands/build/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use crate::{
cli::{self, Cli},
common::contracts::get_project_path,
common::builds::get_project_path,
};
use clap::{Args, Subcommand};
#[cfg(feature = "contract")]
Expand Down
3 changes: 2 additions & 1 deletion crates/pop-cli/src/commands/call/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
use crate::{
cli::{self, traits::*},
common::{
contracts::{get_project_path, has_contract_been_built},
builds::get_project_path,
contracts::has_contract_been_built,
wallet::{prompt_to_use_wallet, request_signature},
},
};
Expand Down
6 changes: 2 additions & 4 deletions crates/pop-cli/src/commands/up/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
use crate::{
cli::{traits::Cli as _, Cli},
common::{
contracts::{
check_contracts_node_and_prompt, get_project_path, has_contract_been_built,
terminate_node,
},
builds::get_project_path,
contracts::{check_contracts_node_and_prompt, has_contract_been_built, terminate_node},
wallet::request_signature,
},
style::style,
Expand Down
11 changes: 11 additions & 0 deletions crates/pop-cli/src/common/builds.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use std::path::PathBuf;

/// This method is used to get the proper project path format (with or without cli flag)
pub fn get_project_path(path_flag: Option<PathBuf>, path_pos: Option<PathBuf>) -> Option<PathBuf> {
let project_path = if let Some(ref path) = path_pos {
Some(path) // Use positional path if present
} else {
path_flag.as_ref() // Otherwise, use the named path
};
project_path.cloned()
}
9 changes: 0 additions & 9 deletions crates/pop-cli/src/common/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,6 @@ pub fn has_contract_been_built(path: Option<&Path>) -> bool {
.unwrap_or_default()
}

pub fn get_project_path(path_flag: Option<PathBuf>, path_pos: Option<PathBuf>) -> Option<PathBuf> {
let project_path = if let Some(ref path) = path_pos {
Some(path) // Use positional path if present
} else {
path_flag.as_ref() // Otherwise, use the named path
};
project_path.cloned()
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down
1 change: 1 addition & 0 deletions crates/pop-cli/src/common/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-3.0

pub mod builds;
#[cfg(feature = "contract")]
pub mod contracts;
pub mod helpers;
Expand Down

0 comments on commit 4b19b40

Please sign in to comment.