From 07eb48cbee6131fd79ded9cb3e794e2c91180c34 Mon Sep 17 00:00:00 2001 From: Frank Date: Fri, 1 Nov 2024 03:05:29 +0000 Subject: [PATCH] fix \ & release 0.1.0 --- .gitignore | 3 ++- Cargo.lock | 2 +- Cargo.toml | 2 +- src/main.rs | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index b2d4c10..0993cc4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target -gc.log \ No newline at end of file +gc.log +.gitpod.yml \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 57a6397..9758603 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -574,7 +574,7 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jtxt" -version = "0.1.0" +version = "0.1.1" dependencies = [ "clap", "deno_core", diff --git a/Cargo.toml b/Cargo.toml index 359b209..13eec4b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jtxt" -version = "0.1.0" +version = "0.1.1" edition = "2021" authors = ["frank "] description = "A JavaScript syntax text processing tool, an awk alternative." diff --git a/src/main.rs b/src/main.rs index 25c78d5..f24e912 100644 --- a/src/main.rs +++ b/src/main.rs @@ -67,7 +67,7 @@ fn main() { let mut vec = vec![]; for line in input.lines() { let line = line.unwrap(); - let line = line.replace("'", "\\'"); + let line = line.replace("\\", "\\\\").replace("'", "\\'"); vec.push(line.to_string()); // 先扔到数组里,每200行,处理一次 if vec.len() == 200 {