From 6a81ba9069a1614311eebec740e9832aee1fa678 Mon Sep 17 00:00:00 2001 From: whyour Date: Sat, 13 Nov 2021 11:14:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=84=9A=E6=9C=AC=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=A0=91=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/api/script.ts | 2 +- shell/task.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/back/api/script.ts b/back/api/script.ts index ce85d2f8..2e418e5c 100644 --- a/back/api/script.ts +++ b/back/api/script.ts @@ -43,7 +43,7 @@ export default (app: Router) => { children.push({ title: childFile, value: childFile, - key: childFile, + key: `${fileOrDir}-${childFile}`, mtime: statObj.mtimeMs, parent: fileOrDir, }); diff --git a/shell/task.sh b/shell/task.sh index 2349c344..708133e7 100755 --- a/shell/task.sh +++ b/shell/task.sh @@ -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