Explained yaml_rust in code + extras
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
changed how we run version.sh added mouse_out.yml to .gitignore
This commit is contained in:
parent
282fe70e69
commit
398d20cebb
@ -21,8 +21,8 @@ steps:
|
||||
- name: build amd64
|
||||
image: rust:1.73-alpine
|
||||
commands:
|
||||
- ./version.sh
|
||||
- apk add --no-cache musl-dev gcc-aarch64-none-elf
|
||||
- pwd && ls -al && ./version.sh
|
||||
- apk add --no-cache musl-dev gcc-aarch64-none-elf bash
|
||||
- mkdir /artifacts/mouse-amd64
|
||||
- cp LICENSE.txt /artifacts/mouse-amd64/
|
||||
- mkdir /artifacts/mouse-arm64
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,3 +2,4 @@
|
||||
.vscode/
|
||||
*.un~
|
||||
*.swp
|
||||
mouse_out.yml
|
||||
|
@ -13,7 +13,6 @@ use crate::gatherers::environment::EnvironmentData;
|
||||
use crate::gatherers::ip::{IPData, IPRouteData};
|
||||
use crate::types::fact::Fact;
|
||||
use clap::Parser;
|
||||
use serde::de::Error;
|
||||
use serde_json::Value;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use yaml_rust::{YamlEmitter, YamlLoader};
|
||||
@ -92,6 +91,9 @@ fn main() {
|
||||
match output_format {
|
||||
"json" => println!("{}", data_output),
|
||||
"yaml" => {
|
||||
// We will run the string back through yaml_rust, for better output compatibility.
|
||||
// We could choose to swwitch serde_yaml out completely but at this time I don't see
|
||||
// a huge value, as once serde_yaml fixes their implementation,...
|
||||
let tmp = format!("---\n{}", data_output);
|
||||
let yr = YamlLoader::load_from_str(tmp.as_str()).unwrap();
|
||||
let mut out = String::new();
|
||||
|
Loading…
Reference in New Issue
Block a user