fix: nix binary should not be mandatory

This commit is contained in:
Akshay 2022-01-23 09:58:11 +05:30
parent 23892b034d
commit bfb11bcffc
3 changed files with 3 additions and 6 deletions

2
Cargo.lock generated
View File

@ -507,7 +507,7 @@ dependencies = [
[[package]]
name = "statix"
version = "0.5.0"
version = "0.5.1"
dependencies = [
"ariadne",
"clap",

View File

@ -1,6 +1,6 @@
[package]
name = "statix"
version = "0.5.0"
version = "0.5.1"
edition = "2018"
license = "MIT"
authors = [ "Akshay <nerdy@peppe.rs>" ]

View File

@ -25,10 +25,7 @@ pub fn lint_map() -> HashMap<SyntaxKind, Vec<&'static Box<dyn Lint>>> {
pub fn get_version_info() -> Option<String> {
use std::process::Command;
let program = Command::new("nix")
.arg("--version")
.output()
.expect("failed to execute");
let program = Command::new("nix").arg("--version").output().ok()?;
std::str::from_utf8(&program.stdout)
.ok()?
.split(' ')