]>
Commit | Line | Data |
---|---|---|
d620665f | 1 | use std::io::Result; |
a9c6be41 | 2 | use crate::configuration::Configuration; |
172f4c88 | 3 | use crate::remote::sync_up; |
d620665f RBR |
4 | |
5 | pub struct SyncUp; | |
6 | ||
7 | impl SyncUp { | |
8 | pub fn new() -> Self { | |
9 | SyncUp | |
10 | } | |
11 | } | |
12 | ||
13 | impl super::Command for SyncUp { | |
14 | fn before_dependencies(&self) -> Vec<Box<dyn super::Command>> { | |
15 | vec![] | |
16 | } | |
17 | ||
172f4c88 RBR |
18 | fn execute(&self, _: Option<&String>, configuration: &Configuration, _: &String) -> Result<()> { |
19 | sync_up(&configuration.data_directory, &configuration.remote_config) | |
d620665f RBR |
20 | } |
21 | ||
22 | fn after_dependencies(&self) -> Vec<Box<dyn super::Command>> { | |
23 | vec![] | |
24 | } | |
25 | ||
26 | fn command(&self) -> &'static str { | |
27 | "sync-up" | |
28 | } | |
29 | ||
30 | fn help(&self) -> &'static str { | |
2f579cf4 | 31 | "\t\t\t\tPushes to the git remote if configured" |
d620665f RBR |
32 | } |
33 | } |