21 lines
532 B
Rust
21 lines
532 B
Rust
use crate::config::config::Config;
|
|
use crate::store::object::Obj;
|
|
use crate::store::{indexer::Indexer, structs};
|
|
|
|
pub struct PushArgs {}
|
|
|
|
pub fn exec(_args: PushArgs, config: Config) {
|
|
structs::init(config.get_root_unsafe());
|
|
|
|
let mut indexer = Indexer::new(config.get_root_unsafe());
|
|
let _ = indexer.load();
|
|
|
|
for indexed_obj in indexer.get_indexed_objs() {
|
|
let local_obj = Obj::from_local_path(&indexed_obj.path);
|
|
local_obj.save().unwrap();
|
|
}
|
|
|
|
indexer.clear();
|
|
let _ = indexer.save();
|
|
}
|