Update hard-coded config example
This commit is contained in:
		@@ -121,20 +121,9 @@ impl Updater {
 | 
			
		||||
    pub fn from_config(opt: &Opt) -> io::Result<Updater> {
 | 
			
		||||
        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.");
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user