mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-22 05:12:27 +00:00
chore: Slightly improve code structure and commenting
This commit is contained in:
parent
9afadee250
commit
d07946fc41
|
@ -106,8 +106,10 @@ pub fn get_tabs(command_dir: &Path, validate: bool) -> Vec<Tab> {
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
for path_index in 1..script_info.ui_path.len() {
|
for path_index in 1..script_info.ui_path.len() {
|
||||||
let path = script_info.ui_path[..path_index].to_vec();
|
let path = &script_info.ui_path[..path_index];
|
||||||
if !paths.contains_key(&path) {
|
// Create tabs and directories which don't yet exist
|
||||||
|
if !paths.contains_key(path) {
|
||||||
|
let path = path.to_vec();
|
||||||
let tab_name = script_info.ui_path[0].clone();
|
let tab_name = script_info.ui_path[0].clone();
|
||||||
if path_index == 1 {
|
if path_index == 1 {
|
||||||
let tab = Tab {
|
let tab = Tab {
|
||||||
|
@ -175,7 +177,7 @@ fn get_script_list(directory: &Path) -> Vec<(PathBuf, PathBuf)> {
|
||||||
} else {
|
} else {
|
||||||
let is_json = path.extension().map_or(false, |ext| ext == "json");
|
let is_json = path.extension().map_or(false, |ext| ext == "json");
|
||||||
let script = path.with_extension("sh");
|
let script = path.with_extension("sh");
|
||||||
(is_json).then_some(vec![(path, script)])
|
is_json.then_some(vec![(path, script)])
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.flatten()
|
.flatten()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user