@@ -8,7 +8,7 @@ use tracing::{debug, error};
8
8
use crate :: config:: { File , Directory , FileContent } ;
9
9
use file_helper:: { get_file, set_file, delete_file, export_file_path} ;
10
10
use 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} ;
12
12
use schemars:: schema_for;
13
13
14
14
mod args;
@@ -40,7 +40,7 @@ fn main() {
40
40
println ! ( "{}" , json) ;
41
41
}
42
42
None => {
43
- let filecontent = match is_fillecontent_type ( input. as_str ( ) ) {
43
+ let filecontent = match is_filecontent_type ( input. as_str ( ) ) {
44
44
Some ( filecontent) => {
45
45
let filecontent = get_file_content ( & filecontent) . unwrap ( ) ;
46
46
let json = serde_json:: to_string ( & filecontent) . unwrap ( ) ;
@@ -73,7 +73,7 @@ fn main() {
73
73
println ! ( "{}" , json) ;
74
74
}
75
75
None => {
76
- let filecontent = match is_fillecontent_type ( input. as_str ( ) ) {
76
+ let filecontent = match is_filecontent_type ( input. as_str ( ) ) {
77
77
Some ( filecontent) => {
78
78
let filecontent = delete_file_content ( & filecontent) . unwrap ( ) ;
79
79
let json = serde_json:: to_string ( & filecontent) . unwrap ( ) ;
@@ -107,11 +107,11 @@ fn main() {
107
107
println ! ( "{}" , json) ;
108
108
}
109
109
None => {
110
- let filecontent = match is_fillecontent_type ( input. as_str ( ) ) {
110
+ let filecontent = match is_filecontent_type ( input. as_str ( ) ) {
111
111
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) ;
115
115
}
116
116
None => {
117
117
error ! ( "Invalid input." ) ;
@@ -142,11 +142,11 @@ fn main() {
142
142
debug ! ( "File exported successfully." ) ;
143
143
}
144
144
None => {
145
- let filecontent = match is_fillecontent_type ( input. as_str ( ) ) {
145
+ let filecontent = match is_filecontent_type ( input. as_str ( ) ) {
146
146
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) ;
150
150
}
151
151
None => {
152
152
error ! ( "Invalid input." ) ;
@@ -200,7 +200,7 @@ fn is_directory_type(input: &str) -> Option<Directory> {
200
200
Some ( dir)
201
201
}
202
202
203
- fn is_fillecontent_type ( input : & str ) -> Option < FileContent > {
203
+ fn is_filecontent_type ( input : & str ) -> Option < FileContent > {
204
204
let filecontent: FileContent = match serde_json:: from_str ( input) {
205
205
Ok ( input) => input,
206
206
Err ( _) => return None ,
0 commit comments