ginst 0.1.4

A generic installation tool, able to read and execute instructions from a json file.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! # Distro
//!
//! Crate containing util functions

use std::process::Command;

/// Get's the distributions name from `/etc/os-release`
pub fn get_dist() -> String {
    let output = Command::new("grep")
                    .args(["^NAME=\".*\"","/etc/os-release"])
                    .output()
                    .expect("Failed to get os information");
    let raw = String::from_utf8(output.stdout).expect("Failed to generate string from stoud");

    return raw.replace(['"', '\n'], "").chars().skip(5).collect();
}