feat: add script.rs
This commit is contained in:
@@ -7,6 +7,7 @@ mod cmd;
|
||||
mod cmd_default;
|
||||
mod cmd_new;
|
||||
mod git;
|
||||
mod script;
|
||||
|
||||
use cmd::{ Command, CommandError };
|
||||
use cmd_default::CommandDefault;
|
||||
|
||||
10
src/script.rs
Normal file
10
src/script.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
pub fn _get_script_base_path(base: &PathBuf, file_name: &str) -> PathBuf {
|
||||
let mut file_name_chars = file_name.chars();
|
||||
let path = base.join(file_name_chars.next().unwrap_or('_').to_string())
|
||||
.join(file_name_chars.next().unwrap_or('_').to_string())
|
||||
.join(file_name_chars.next().unwrap_or('_').to_string())
|
||||
.join(file_name);
|
||||
path
|
||||
}
|
||||
Reference in New Issue
Block a user