feat: v1.7.7, support exec-env comment

This commit is contained in:
2024-01-13 11:02:01 +08:00
parent 784765fbb9
commit e31f6d49b7
3 changed files with 5 additions and 3 deletions

2
Cargo.lock generated
View File

@@ -1847,7 +1847,7 @@ dependencies = [
[[package]]
name = "tiny-encrypt"
version = "1.7.6"
version = "1.7.7"
dependencies = [
"aes-gcm-stream",
"base64",

View File

@@ -1,6 +1,6 @@
[package]
name = "tiny-encrypt"
version = "1.7.6"
version = "1.7.7"
edition = "2021"
license = "MIT"
description = "A simple and tiny file encrypt tool"

View File

@@ -145,7 +145,9 @@ fn parse_output_to_env(output: &str) -> Vec<(String, String)> {
} else {
let lines = output.split('\n');
lines.filter(|ln| !ln.trim().is_empty()).for_each(|ln| {
if ln.contains('=') {
if ln.starts_with('#') {
debugging!("Found comment: {}", ln);
} else if ln.contains('=') {
let k = ln.chars().take_while(|c| c != &'=').collect::<String>();
let v = ln.chars().skip_while(|c| c != &'=').skip(1).collect::<String>();
env.push((k, v));