rename get_pacdef_group_dir to get_group_dir
This commit is contained in:
+2
-2
@@ -20,7 +20,7 @@ use std::process::{ExitCode, Termination};
|
||||
use anyhow::{Context, Result};
|
||||
|
||||
use pacdef_core as core;
|
||||
use pacdef_core::{get_args, get_config_path, get_pacdef_group_dir, Config, Group, Pacdef};
|
||||
use pacdef_core::{get_args, get_config_path, get_group_dir, Config, Group, Pacdef};
|
||||
|
||||
fn main() -> ExitCode {
|
||||
handle_final_result(main_inner())
|
||||
@@ -49,7 +49,7 @@ fn main_inner() -> Result<()> {
|
||||
let config_file = get_config_path().context("getting config file")?;
|
||||
let config = Config::load(&config_file).context("loading config file")?;
|
||||
|
||||
let group_dir = get_pacdef_group_dir().context("resolving group dir")?;
|
||||
let group_dir = get_group_dir().context("resolving group dir")?;
|
||||
let groups = Group::load(&group_dir, config.warn_not_symlinks).context("loading groups")?;
|
||||
|
||||
let pacdef = Pacdef::new(args, config, groups);
|
||||
|
||||
@@ -11,7 +11,7 @@ use crate::args;
|
||||
use crate::backend::{Backend, Backends, ToDoPerBackend};
|
||||
use crate::cmd::run_edit_command;
|
||||
use crate::env::get_single_var;
|
||||
use crate::path::get_pacdef_group_dir;
|
||||
use crate::path::get_group_dir;
|
||||
use crate::review;
|
||||
use crate::search;
|
||||
use crate::ui::get_user_confirmation;
|
||||
@@ -124,7 +124,7 @@ impl Pacdef {
|
||||
|
||||
#[allow(clippy::unused_self)]
|
||||
fn edit_group_files(&self, groups: &ArgMatches) -> Result<()> {
|
||||
let group_dir = crate::path::get_pacdef_group_dir()?;
|
||||
let group_dir = crate::path::get_group_dir()?;
|
||||
|
||||
let files: Vec<_> = groups
|
||||
.get_many::<String>("group")
|
||||
@@ -248,7 +248,7 @@ impl Pacdef {
|
||||
#[allow(clippy::unused_self)]
|
||||
fn import_groups(&self, args: &ArgMatches) -> Result<()> {
|
||||
let files = args::get_absolutized_file_paths(args)?;
|
||||
let groups_dir = get_pacdef_group_dir()?;
|
||||
let groups_dir = get_group_dir()?;
|
||||
|
||||
for target in files {
|
||||
let target_name = target
|
||||
@@ -315,7 +315,7 @@ impl Pacdef {
|
||||
}
|
||||
|
||||
fn get_assumed_group_file_names(arg_match: &ArgMatches) -> Result<Vec<PathBuf>> {
|
||||
let groups_dir = get_pacdef_group_dir()?;
|
||||
let groups_dir = get_group_dir()?;
|
||||
|
||||
let paths: Vec<_> = arg_match
|
||||
.get_many::<String>("groups")
|
||||
|
||||
@@ -33,7 +33,7 @@ pub use crate::config::Config;
|
||||
pub use crate::core::Pacdef;
|
||||
pub use crate::grouping::Group;
|
||||
pub(crate) use crate::grouping::Package;
|
||||
pub use crate::path::{get_config_path, get_pacdef_group_dir};
|
||||
pub use crate::path::{get_config_path, get_group_dir};
|
||||
pub use crate::search::NO_PACKAGES_FOUND;
|
||||
|
||||
extern crate pacdef_macros;
|
||||
|
||||
@@ -7,7 +7,7 @@ const CONFIG_FILE_NAME: &str = "pacdef.yaml";
|
||||
|
||||
/// Get the group directory where all group files are located. This is
|
||||
/// `$XDG_CONFIG_HOME/pacdef/groups`, which defaults to `$HOME/.config/pacdef/groups`.
|
||||
pub fn get_pacdef_group_dir() -> Result<PathBuf> {
|
||||
pub fn get_group_dir() -> Result<PathBuf> {
|
||||
let mut result = get_pacdef_base_dir().context("getting pacdef base dir")?;
|
||||
result.push("groups");
|
||||
Ok(result)
|
||||
|
||||
Reference in New Issue
Block a user