From 595679556496e036cb13ac2f24d1b2611f4cc00f Mon Sep 17 00:00:00 2001 From: Zykino Date: Sun, 5 Feb 2023 19:41:05 +0100 Subject: [PATCH] Update hard-coded config example --- src/command.rs | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/command.rs b/src/command.rs index eccb64f..5f1f03a 100644 --- a/src/command.rs +++ b/src/command.rs @@ -121,20 +121,9 @@ impl Updater { pub fn from_config(opt: &Opt) -> io::Result { let mut updater = Updater::new(); + // Example to generate a config file if false { 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 { name: "Rustup".to_owned(), @@ -148,6 +137,20 @@ impl Updater { }, 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); panic!("Wrote a config sample.");