Merge branch 'imag-contact/retrieve-instead-of-create'
This commit is contained in:
commit
42247170a6
1 changed files with 2 additions and 2 deletions
|
@ -170,7 +170,7 @@ fn import(rt: &Runtime) {
|
||||||
if path.is_file() {
|
if path.is_file() {
|
||||||
let _ = rt
|
let _ = rt
|
||||||
.store()
|
.store()
|
||||||
.create_from_path(&path)
|
.retrieve_from_path(&path)
|
||||||
.map_err_trace_exit_unwrap(1);
|
.map_err_trace_exit_unwrap(1);
|
||||||
} else if path.is_dir() {
|
} else if path.is_dir() {
|
||||||
for entry in WalkDir::new(path).min_depth(1).into_iter() {
|
for entry in WalkDir::new(path).min_depth(1).into_iter() {
|
||||||
|
@ -182,7 +182,7 @@ fn import(rt: &Runtime) {
|
||||||
let pb = PathBuf::from(entry.path());
|
let pb = PathBuf::from(entry.path());
|
||||||
let _ = rt
|
let _ = rt
|
||||||
.store()
|
.store()
|
||||||
.create_from_path(&pb)
|
.retrieve_from_path(&pb)
|
||||||
.map_err_trace_exit_unwrap(1);
|
.map_err_trace_exit_unwrap(1);
|
||||||
info!("Imported: {}", entry.path().to_str().unwrap_or("<non UTF-8 path>"));
|
info!("Imported: {}", entry.path().to_str().unwrap_or("<non UTF-8 path>"));
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue