修复脚本管理树结构

This commit is contained in:
whyour 2021-11-13 11:14:43 +08:00
parent 61883776f2
commit 6a81ba9069
2 changed files with 4 additions and 4 deletions

View File

@ -43,7 +43,7 @@ export default (app: Router) => {
children.push({
title: childFile,
value: childFile,
key: childFile,
key: `${fileOrDir}-${childFile}`,
mtime: statObj.mtimeMs,
parent: fileOrDir,
});

View File

@ -106,7 +106,7 @@ run_normal() {
cd $dir_scripts
local relative_path="${first_param%/*}"
if [[ ! -z ${relative_path} ]]; then
if [[ ! -z ${relative_path} ]] && [[ ${first_param} =~ "/" ]]; then
cd ${relative_path}
first_param=${first_param/$relative_path\//}
fi
@ -174,7 +174,7 @@ run_concurrent() {
cd $dir_scripts
local relative_path="${first_param%/*}"
if [[ ! -z ${relative_path} ]]; then
if [[ ! -z ${relative_path} ]] && [[ ${first_param} =~ "/" ]]; then
cd ${relative_path}
first_param=${first_param/$relative_path\//}
fi
@ -248,7 +248,7 @@ run_designated() {
cd $dir_scripts
local relative_path="${file_param%/*}"
if [[ ! -z ${relative_path} ]]; then
if [[ ! -z ${relative_path} ]] && [[ ${file_param} =~ "/" ]]; then
cd ${relative_path}
file_param=${file_param/$relative_path\//}
fi