Update hard-coded config example
This commit is contained in:
parent
e38a95d494
commit
5956795564
@ -121,20 +121,9 @@ impl Updater {
|
|||||||
pub fn from_config(opt: &Opt) -> io::Result<Updater> {
|
pub fn from_config(opt: &Opt) -> io::Result<Updater> {
|
||||||
let mut updater = Updater::new();
|
let mut updater = Updater::new();
|
||||||
|
|
||||||
|
// Example to generate a config file
|
||||||
if false {
|
if false {
|
||||||
updater.systems.push(System { packages: vec![] });
|
updater.systems.push(System { packages: vec![] });
|
||||||
updater.systems[0].packages.push(Package {
|
|
||||||
name: "apt".to_owned(),
|
|
||||||
fetch: None,
|
|
||||||
compile: None,
|
|
||||||
install: Cmd {
|
|
||||||
exe: "()".to_owned(),
|
|
||||||
params: vec![],
|
|
||||||
current_dir: None,
|
|
||||||
env: HashMap::new(),
|
|
||||||
},
|
|
||||||
post_install: None,
|
|
||||||
});
|
|
||||||
|
|
||||||
updater.systems[0].packages.push(Package {
|
updater.systems[0].packages.push(Package {
|
||||||
name: "Rustup".to_owned(),
|
name: "Rustup".to_owned(),
|
||||||
@ -148,6 +137,20 @@ impl Updater {
|
|||||||
},
|
},
|
||||||
post_install: None,
|
post_install: None,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
updater.systems[0].packages.push(Package {
|
||||||
|
name: "Cargo".to_owned(),
|
||||||
|
fetch: None,
|
||||||
|
compile: None,
|
||||||
|
install: Cmd {
|
||||||
|
exe: "cargo".to_owned(),
|
||||||
|
params: vec!["install-update".to_owned(), "-a".to_owned()],
|
||||||
|
current_dir: None,
|
||||||
|
env: HashMap::new(),
|
||||||
|
},
|
||||||
|
post_install: None,
|
||||||
|
});
|
||||||
|
|
||||||
updater.write_config(opt);
|
updater.write_config(opt);
|
||||||
|
|
||||||
panic!("Wrote a config sample.");
|
panic!("Wrote a config sample.");
|
||||||
|
Loading…
Reference in New Issue
Block a user