@@ -8,7 +8,7 @@ use tracing::{debug, error};
88use crate :: config:: { File , Directory , FileContent } ;
99use file_helper:: { get_file, set_file, delete_file, export_file_path} ;
1010use dir_helpers:: { get_dir, set_dir, delete_dir, export_dir_path} ;
11- use filecontent_helper:: { get_file_content, delete_file_content} ;
11+ use filecontent_helper:: { get_file_content, set_file_content , delete_file_content} ;
1212use schemars:: schema_for;
1313
1414mod args;
@@ -40,7 +40,7 @@ fn main() {
4040 println ! ( "{}" , json) ;
4141 }
4242 None => {
43- let filecontent = match is_fillecontent_type ( input. as_str ( ) ) {
43+ let filecontent = match is_filecontent_type ( input. as_str ( ) ) {
4444 Some ( filecontent) => {
4545 let filecontent = get_file_content ( & filecontent) . unwrap ( ) ;
4646 let json = serde_json:: to_string ( & filecontent) . unwrap ( ) ;
@@ -73,7 +73,7 @@ fn main() {
7373 println ! ( "{}" , json) ;
7474 }
7575 None => {
76- let filecontent = match is_fillecontent_type ( input. as_str ( ) ) {
76+ let filecontent = match is_filecontent_type ( input. as_str ( ) ) {
7777 Some ( filecontent) => {
7878 let filecontent = delete_file_content ( & filecontent) . unwrap ( ) ;
7979 let json = serde_json:: to_string ( & filecontent) . unwrap ( ) ;
@@ -107,11 +107,11 @@ fn main() {
107107 println ! ( "{}" , json) ;
108108 }
109109 None => {
110- let filecontent = match is_fillecontent_type ( input. as_str ( ) ) {
110+ let filecontent = match is_filecontent_type ( input. as_str ( ) ) {
111111 Some ( filecontent) => {
112- // let filecontent = get_file (&filecontent).unwrap();
113- // let json = serde_json::to_string(&filecontent).unwrap();
114- // println!("{}", json);
112+ let filecontent = set_file_content ( & filecontent) . unwrap ( ) ;
113+ let json = serde_json:: to_string ( & filecontent) . unwrap ( ) ;
114+ println ! ( "{}" , json) ;
115115 }
116116 None => {
117117 error ! ( "Invalid input." ) ;
@@ -142,11 +142,11 @@ fn main() {
142142 debug ! ( "File exported successfully." ) ;
143143 }
144144 None => {
145- let filecontent = match is_fillecontent_type ( input. as_str ( ) ) {
145+ let filecontent = match is_filecontent_type ( input. as_str ( ) ) {
146146 Some ( filecontent) => {
147- // let filecontent = get_file (&filecontent).unwrap();
148- // let json = serde_json::to_string(&filecontent).unwrap();
149- // println!("{}", json);
147+ let filecontent = get_file_content ( & filecontent) . unwrap ( ) ;
148+ let json = serde_json:: to_string ( & filecontent) . unwrap ( ) ;
149+ println ! ( "{}" , json) ;
150150 }
151151 None => {
152152 error ! ( "Invalid input." ) ;
@@ -200,7 +200,7 @@ fn is_directory_type(input: &str) -> Option<Directory> {
200200 Some ( dir)
201201}
202202
203- fn is_fillecontent_type ( input : & str ) -> Option < FileContent > {
203+ fn is_filecontent_type ( input : & str ) -> Option < FileContent > {
204204 let filecontent: FileContent = match serde_json:: from_str ( input) {
205205 Ok ( input) => input,
206206 Err ( _) => return None ,
0 commit comments