修复脚本路径问题
This commit is contained in:
parent
1774606938
commit
a337436c3a
8
run.sh
8
run.sh
@ -7,13 +7,12 @@ fi
|
|||||||
|
|
||||||
declare -a function_array
|
declare -a function_array
|
||||||
declare selected_function
|
declare selected_function
|
||||||
declare script_path=$(dirname $0)
|
declare script_path=$(dirname $(readlink -f $0))
|
||||||
script_path="${script_path}/Config"
|
script_path="${script_path}/Config"
|
||||||
declare local_path=$script_path
|
declare local_path=$script_path
|
||||||
declare script_name
|
declare script_name
|
||||||
|
|
||||||
while true
|
while true; do
|
||||||
do
|
|
||||||
# 1. 目录初始化脚本 _init.sh
|
# 1. 目录初始化脚本 _init.sh
|
||||||
if [[ -e "${local_path}/_init.sh" ]]; then
|
if [[ -e "${local_path}/_init.sh" ]]; then
|
||||||
bash "${local_path}/_init.sh"
|
bash "${local_path}/_init.sh"
|
||||||
@ -35,8 +34,7 @@ fi
|
|||||||
selected_function=0
|
selected_function=0
|
||||||
function_array=()
|
function_array=()
|
||||||
echo "======$(basename $local_path .sh)======"
|
echo "======$(basename $local_path .sh)======"
|
||||||
for i in "${local_path}"/*
|
for i in "${local_path}"/*; do
|
||||||
do
|
|
||||||
script_name=$(awk -F '.' '{print $1}' <<<"$(basename $i)")
|
script_name=$(awk -F '.' '{print $1}' <<<"$(basename $i)")
|
||||||
# 忽略特殊文件
|
# 忽略特殊文件
|
||||||
if [[ $script_name =~ ^_ ]]; then
|
if [[ $script_name =~ ^_ ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user