Rename source to sources for consistency

This commit is contained in:
Olivier 'reivilibre' 2021-11-13 21:16:06 +00:00
parent 6234022c0d
commit 72d716ebd1
8 changed files with 8 additions and 8 deletions

View File

@ -190,7 +190,7 @@ fn main() -> anyhow::Result<()> {
} => {
let my_hostname = get_hostname();
let descriptor = load_descriptor(Path::new(".")).unwrap();
let source = &descriptor.source[&source_name];
let source = &descriptor.sources[&source_name];
let destination = &descriptor.piles[&destination_name];
let mut pbar = ProgressBar::with_draw_target(0, ProgressDrawTarget::stdout_with_hz(10));

View File

@ -46,7 +46,7 @@ pub fn init_descriptor(path: &Path) -> anyhow::Result<()> {
"precious".to_owned(),
"bulky".to_owned(),
],
source,
sources: source,
piles: Default::default(),
remote_hosts: Default::default(),
})?;

View File

@ -340,7 +340,7 @@ pub fn backup_all_sources_to_destination<PT: ProgressTracker>(
other => Some(other.to_string()),
};
for (source_name, source_descriptor) in descriptor.source.iter() {
for (source_name, source_descriptor) in descriptor.sources.iter() {
if let (Some(source_host), Some(restricted_host)) = (
source_descriptor.get_remote_hostname(),
restricted_remote.as_ref(),

View File

@ -66,7 +66,7 @@ pub fn extract(
}
},
None => {
for source in descriptor.source.keys() {
for source in descriptor.sources.keys() {
match find_pointer_for_source(source, &pile, &before, &after)? {
None => {
warn!("No pointer found for {:?}! Carrying on anyway...", source);

View File

@ -64,7 +64,7 @@ pub fn session(path: &Path, source_name: String) -> anyhow::Result<()> {
let descriptor = load_descriptor(path)?;
let source_descriptor = descriptor
.source
.sources
.get(&source_name)
.ok_or_else(|| anyhow!("Could not find source {:?}!", source_name))?;

View File

@ -179,7 +179,7 @@ pub fn interactive_labelling_session(path: &Path, source_name: String) -> anyhow
let descriptor: Descriptor = load_descriptor(path)?;
let source = descriptor
.source
.sources
.get(&source_name)
.ok_or_else(|| anyhow!("No source found by that name!"))?;

View File

@ -32,7 +32,7 @@ pub struct Descriptor {
pub labels: Vec<String>,
/// Sources
pub source: HashMap<String, SourceDescriptor>,
pub sources: HashMap<String, SourceDescriptor>,
/// Paths to destination Yama Piles. Remote Piles need a local virtual pile to specify the layers.
pub piles: HashMap<String, DestPileDescriptor>,

View File

@ -17,7 +17,7 @@ Run `datman init` in an empty directory.
Add a section like the following to your `datman.toml`:
```toml
[source.mysourcename]
[sources.mysourcename]
directory = "/path/to/source"
hostname = "myhostname"
```