Skip to content

Commit

Permalink
[src/lib/**.rs] Make public useful symbols for use cargo-make as …
Browse files Browse the repository at this point in the history
…library
  • Loading branch information
SamuelMarks committed Jul 8, 2024
1 parent 69cbfc8 commit 6cf5942
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/lib/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub(crate) static DEFAULT_LOG_LEVEL: &str = "info";
pub(crate) static DEFAULT_TASK_NAME: &str = "default";
pub(crate) static DEFAULT_OUTPUT_FORMAT: &str = "default";

fn run(cli_args: CliArgs, global_config: &GlobalConfig) {
pub fn run(cli_args: CliArgs, global_config: &GlobalConfig) {
let start_time = SystemTime::now();

recursion_level::increment();
Expand Down
4 changes: 2 additions & 2 deletions src/lib/cli_commands/list_steps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::io;
use crate::types::{Config, DeprecationInfo};
use std::collections::{BTreeMap, BTreeSet};

pub(crate) fn run(
pub fn run(
config: &Config,
output_format: &str,
output_file: &Option<String>,
Expand Down Expand Up @@ -186,7 +186,7 @@ pub(crate) fn create_list(
}

if !just_task_name {
buffer.push_str(&format!("\n"));
buffer.push('\n');
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/lib/cli_commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
//!
pub(crate) mod diff_steps;
pub(crate) mod list_steps;
pub(crate) mod print_steps;
pub mod list_steps;
pub mod print_steps;
2 changes: 1 addition & 1 deletion src/lib/cli_commands/print_steps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fn print_default(execution_plan: &ExecutionPlan) {
}

/// Only prints the execution plan
pub(crate) fn print(
pub fn print(
config: &Config,
task: &str,
output_format: &str,
Expand Down
6 changes: 3 additions & 3 deletions src/lib/cli_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ fn get_args(
cli_args
}

fn create_cli(global_config: &GlobalConfig) -> CliSpec {
pub fn create_cli(global_config: &GlobalConfig) -> CliSpec {
let default_task_name = match global_config.default_task_name {
Some(ref value) => value.as_str(),
None => &DEFAULT_TASK_NAME,
Expand Down Expand Up @@ -468,7 +468,7 @@ fn create_cli(global_config: &GlobalConfig) -> CliSpec {
spec
}

pub(crate) fn parse_args(
pub fn parse_args(
global_config: &GlobalConfig,
command_name: &str,
sub_command: bool,
Expand Down Expand Up @@ -505,7 +505,7 @@ pub(crate) fn parse_args(
}
}

pub(crate) fn parse(
pub fn parse(
global_config: &GlobalConfig,
command_name: &str,
sub_command: bool,
Expand Down
8 changes: 4 additions & 4 deletions src/lib/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ use fsio::file::read_text_file;
use fsio::path::from_path::FromPath;
use std::path::{Path, PathBuf};

static CONFIG_FILE: &'static str = "config.toml";
pub static CONFIG_FILE: &'static str = "config.toml";

fn get_config_directory() -> Option<PathBuf> {
pub fn get_config_directory() -> Option<PathBuf> {
let os_directory = dirs_next::config_dir();
storage::get_storage_directory(os_directory, CONFIG_FILE, true)
}

fn load_from_path(directory: PathBuf) -> GlobalConfig {
pub fn load_from_path(directory: PathBuf) -> GlobalConfig {
let file_path = Path::new(&directory).join(CONFIG_FILE);
debug!("Loading config from: {:#?}", &file_path);

Expand All @@ -47,7 +47,7 @@ fn load_from_path(directory: PathBuf) -> GlobalConfig {
}

/// Returns the configuration
pub(crate) fn load() -> GlobalConfig {
pub fn load() -> GlobalConfig {
match get_config_directory() {
Some(directory) => load_from_path(directory),
None => GlobalConfig::new(),
Expand Down
8 changes: 4 additions & 4 deletions src/lib/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ mod test;
pub mod types;

mod cache;
mod cli;
mod cli_commands;
mod cli_parser;
pub mod cli;
pub mod cli_commands;
pub mod cli_parser;
mod command;
mod condition;
mod config;
pub mod config;
mod descriptor;
mod environment;
mod execution_plan;
Expand Down

0 comments on commit 6cf5942

Please sign in to comment.