Crates.io | tanzhenhui_code_lib |
lib.rs | tanzhenhui_code_lib |
version | 0.6.5 |
source | src |
created_at | 2024-09-11 03:03:41.414862 |
updated_at | 2024-11-27 12:11:38.495859 |
description | toolbox for my own |
homepage | |
repository | |
max_upload_size | |
id | 1371554 |
size | 17,829 |
use tanzhenhui_code_lib::generate_get_ini_info;
generate_get_ini_info!(bz_dir, input_dir, output_dir, password);
this will read a file named "config.ini" in the same path of your program. in this example,the file will be like this:
[common]
you can get the info in the other place of your code like this:
let IniInfo {
bz_dir,
input_dir,
output_dir,
password,
} = get_ini_info();
and you get four String variable in your code
use std::path::Path;
use tanzhenhui_code_lib::git_helper;
let path = Path::new(r"D:\PlugInSystem");
git_helper::git_command(path,"git branch -D branch_name");
it's equals to "cd D:\PlugInSystem && git branch -D branch_name"
You can look at the source code and look for some packaged git commands in GitManager what's more, a simplified merge request for gitlab is provided