<commit_before>use std::path::Path;
use std::env;
use std::process::Command;
use super::es::traits::*;
extern crate open;

pub fn open(p: &Path) {
    open::that(p).or_die("cannot open");
}

pub fn edit(p: &Path) {
    // Respect POSIX
    let editor = if let Ok(ed) = env::var("VISUAL") {
        ed
    } else
    if let Ok(ed) = env::var("EDITOR") {
        ed
    } else
    // MacOS open will NOT open random text files, so vim it is...
    if cfg!(macos) {
        "vim".into()
    } else
    if cfg!(windows) {
		// likewise, regular 'start' won't cope with files-without-known-extensions
		// Notepad is useless, so use Wordpad
		"write".into()<commit_msg>use target_os. Now works on MacOS again<commit_after>use std::path::Path;
use std::env;
use std::process::Command;
use super::es::traits::*;
extern crate open;

pub fn open(p: &Path) {
    open::that(p).or_die("cannot open");
}

pub fn edit(p: &Path) {
    // Respect POSIX
    let editor = if let Ok(ed) = env::var("VISUAL") {
        ed
    } else
    if let Ok(ed) = env::var("EDITOR") {
        ed
    } else
    // MacOS open will NOT open random text files, so vim it is...
    if cfg!(target_os = "macos") {
        "vim".into()
    } else
    if cfg!(target_os = "windows") {
        // likewise, regular 'start' won't cope with files-without-known-extensions
        // Notepad is useless, so use Wordpad
        "write".into()
{'fraction_non_alphanumeric': 0.15928571428571428, 'fraction_numerical': 0.0, 'mean_word_length': 2.7063492063492065, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1150074', 'n_tokens_mistral': 494, 'n_tokens_neox': 478, 'n_words': 145}