Skip to content

Commit

Permalink
repos: add flutter (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
skyzh authored Dec 14, 2020
1 parent f1b4be7 commit cef1441
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ async fn main() {
(@arg zip_master: --zip_master +takes_value default_value("https://github.com/rust-lang/crates.io-index/archive/master.zip") "zip of crates.io-index master")
(@arg target: --target +takes_value default_value("https://siyuan.internal.sjtug.org/crates.io/crates") "mirror-intel target")
)
(@subcommand flutter_infra =>
(about: "mirror flutter_infra from tuna to siyuan mirror-intel with simple diff transfer")
(version: "1.0")
(author: "Alex Chi <iskyzh@gmail.com>")
(@arg base: --base +takes_value default_value("rsync://nanomirrors.tuna.tsinghua.edu.cn/flutter/flutter_infra/") "package base")
(@arg target: --target +takes_value default_value("https://siyuan.internal.sjtug.org/flutter_infra") "mirror-intel target")
)
)
.get_matches();

Expand Down Expand Up @@ -161,6 +168,21 @@ async fn main() {
);
transfer.transfer().await.unwrap();
}
("flutter_infra", Some(sub_matches)) => {
let source = rsync::Rsync {
base: sub_matches.value_of("base").unwrap().to_string(),
debug: matches.is_present("debug"),
ignore_prefix: "".to_string(),
};
let target =
mirror_intel::MirrorIntel::new(sub_matches.value_of("target").unwrap().to_string());
let transfer = simple_diff_transfer::SimpleDiffTransfer::new(
source,
target,
simple_diff_transfer::SimpleDiffTransferConfig { progress },
);
transfer.transfer().await.unwrap();
}
_ => {
println!("use ./mirror_clone --help to view commands");
}
Expand Down

0 comments on commit cef1441

Please sign in to comment.