mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-03-10 23:41:22 +00:00
~优化测试相关命令
~优化版本回退功能,现在支持回退到近期tags
This commit is contained in:
@@ -248,24 +248,30 @@ case "$1" in
|
|||||||
main_menu
|
main_menu
|
||||||
;;
|
;;
|
||||||
-t)
|
-t)
|
||||||
shtype=sh && [ -n "$(ls -l /bin/sh | grep -o dash)" ] && shtype=bash
|
shtype=sh
|
||||||
$shtype -x "$CRASHDIR"/menu.sh
|
[ -n "$(ls -l /bin/sh | grep -o dash)" ] && shtype=bash
|
||||||
|
"$shtype" -x "$CRASHDIR"/menu.sh
|
||||||
;;
|
;;
|
||||||
-s)
|
-s)
|
||||||
"$CRASHDIR"/start.sh $2 $3 $4 $5 $6
|
"$CRASHDIR"/start.sh "$2" "$3" "$4" "$5" "$6"
|
||||||
;;
|
;;
|
||||||
-i)
|
-i)
|
||||||
. "$CRASHDIR"/init.sh 2>/dev/null
|
. "$CRASHDIR"/init.sh 2>/dev/null
|
||||||
;;
|
;;
|
||||||
-st)
|
-st)
|
||||||
shtype=sh && [ -n "$(ls -l /bin/sh | grep -o dash)" ] && shtype=bash
|
shtype=sh
|
||||||
$shtype -x "$CRASHDIR"/start.sh $2 $3 $4 $5 $6
|
ckcmd bash && shtype=bash
|
||||||
|
"$shtype" -x "$CRASHDIR"/starts/bfstart.sh
|
||||||
|
. "$CRASHDIR"/starts/start_legacy.sh
|
||||||
|
start_legacy "$COMMAND" 'shellcrash'
|
||||||
|
"$shtype" -x "$CRASHDIR"/starts/afstart.sh
|
||||||
|
"$CRASHDIR"/start.sh stop
|
||||||
;;
|
;;
|
||||||
-d)
|
-d)
|
||||||
shtype=sh && [ -n "$(ls -l /bin/sh | grep -o dash)" ] && shtype=bash
|
shtype=sh && [ -n "$(ls -l /bin/sh | grep -o dash)" ] && shtype=bash
|
||||||
echo -e "$MENU_TEST_RUNNING\033[32;4mt.me/ShellClash\033[0m"
|
echo -e "$MENU_TEST_RUNNING\033[32;4mt.me/ShellClash\033[0m"
|
||||||
$shtype "$CRASHDIR"/start.sh debug >/dev/null 2>"$TMPDIR"/debug_sh_bug.log
|
"$shtype" "$CRASHDIR"/start.sh debug >/dev/null 2>"$TMPDIR"/debug_sh_bug.log
|
||||||
$shtype -x "$CRASHDIR"/start.sh debug >/dev/null 2>"$TMPDIR"/debug_sh.log
|
"$shtype" -x "$CRASHDIR"/start.sh debug >/dev/null 2>"$TMPDIR"/debug_sh.log
|
||||||
echo -----------------------------------------
|
echo -----------------------------------------
|
||||||
cat "$TMPDIR"/debug_sh_bug.log | grep 'start\.sh' >"$TMPDIR"/sh_bug
|
cat "$TMPDIR"/debug_sh_bug.log | grep 'start\.sh' >"$TMPDIR"/sh_bug
|
||||||
if [ -s "$TMPDIR"/sh_bug ]; then
|
if [ -s "$TMPDIR"/sh_bug ]; then
|
||||||
|
|||||||
@@ -1374,16 +1374,17 @@ setserver() {
|
|||||||
separator_line "="
|
separator_line "="
|
||||||
if [ -n "$url_id" ] && [ "$url_id" -lt 200 ]; then
|
if [ -n "$url_id" ] && [ "$url_id" -lt 200 ]; then
|
||||||
content_line "\033[32m正在获取版本信息......\033[0m"
|
content_line "\033[32m正在获取版本信息......\033[0m"
|
||||||
get_bin "$TMPDIR"/release_version bin/release_version
|
. "$CRASHDIR"/libs/web_get_lite.sh
|
||||||
if [ "$?" = "0" ]; then
|
web_get_lite https://github.com/juewuy/ShellCrash/tags | grep -o 'releases/tag/.*data'|awk -F '/' '{print $3}'|sed 's/".*//g' > "$TMPDIR"/tags
|
||||||
|
if [ "$?" = "0" ]; then
|
||||||
content_line "\033[32m获取版本信息成功\033[0m"
|
content_line "\033[32m获取版本信息成功\033[0m"
|
||||||
separator_line "="
|
separator_line "="
|
||||||
|
|
||||||
line_break
|
line_break
|
||||||
separator_line "="
|
separator_line "="
|
||||||
content_line "\033[31m请选择想要回退至的稳定版版本:\033[0m"
|
content_line "\033[31m请选择想要回退至的具体版本:\033[0m"
|
||||||
|
|
||||||
cat "$TMPDIR"/release_version |
|
cat "$TMPDIR"/tags |
|
||||||
awk '{print NR") "$1}' |
|
awk '{print NR") "$1}' |
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
content_line "$line"
|
content_line "$line"
|
||||||
@@ -1394,8 +1395,8 @@ setserver() {
|
|||||||
read -r -p "请输入对应标号> " num
|
read -r -p "请输入对应标号> " num
|
||||||
if [ -z "$num" ] || [ "$num" = 0 ]; then
|
if [ -z "$num" ] || [ "$num" = 0 ]; then
|
||||||
continue
|
continue
|
||||||
elif [ "$num" -le $(cat "$TMPDIR"/release_version 2>/dev/null | awk 'END{print NR}') ]; then
|
elif [ "$num" -le $(cat "$TMPDIR"/tags 2>/dev/null | awk 'END{print NR}') ]; then
|
||||||
release_type=$(cat "$TMPDIR"/release_version | awk '{print $1}' | sed -n "$num"p)
|
release_type=$(cat "$TMPDIR"/tags | awk '{print $1}' | sed -n "$num"p)
|
||||||
update_url=''
|
update_url=''
|
||||||
saveserver
|
saveserver
|
||||||
else
|
else
|
||||||
@@ -1409,7 +1410,7 @@ setserver() {
|
|||||||
sleep 1
|
sleep 1
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
rm -rf "$TMPDIR"/release_version
|
rm -rf "$TMPDIR"/tags
|
||||||
else
|
else
|
||||||
content_line "\033[31m当前源不支持版本回退\033[0m"
|
content_line "\033[31m当前源不支持版本回退\033[0m"
|
||||||
content_line "\033[31m请尝试更换其他安装源!\033[0m"
|
content_line "\033[31m请尝试更换其他安装源!\033[0m"
|
||||||
|
|||||||
Reference in New Issue
Block a user