修复旧版本 bash 下语法错误

Fixes #73
This commit is contained in:
bin456789 2024-04-10 21:41:46 +08:00
parent 3ba90cdd27
commit 001d1c5783
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B
3 changed files with 16 additions and 16 deletions

View File

@ -133,7 +133,7 @@ bash reinstall.sh windows \
```bash
bash reinstall.sh windows \
--image-name 'Windows 10 Enterprise LTSC 2021'
--image-name 'Windows 10 Enterprise LTSC 2021' \
--lang zh-cn
```

View File

@ -133,7 +133,7 @@ bash reinstall.sh windows \
```bash
bash reinstall.sh windows \
--image-name 'Windows 10 Enterprise LTSC 2021'
--image-name 'Windows 10 Enterprise LTSC 2021' \
--lang zh-cn
```

View File

@ -594,20 +594,10 @@ get_windows_iso_links() {
esac
}
# 部分 bash 不支持 $() 里面嵌套case所以定义成函数
label_msdn=$(get_label_msdn)
label_vlsc=$(get_label_vlsc)
if grep -Ewq 'ltsb|ltsc' <<<"$edition"; then
is_ltsc=true
else
is_ltsc=false
fi
page=$(
get_page() {
if [ "$arch_win" = arm64 ]; then
echo arm
elif $is_ltsc; then
elif is_ltsc; then
echo ltsc
elif [ "$server" = 'server' ]; then
echo server
@ -618,7 +608,17 @@ get_windows_iso_links() {
;;
esac
fi
)
}
is_ltsc() {
grep -Ewq 'ltsb|ltsc' <<<"$edition"
}
# 部分 bash 不支持 $() 里面嵌套case所以定义成函数
label_msdn=$(get_label_msdn)
label_vlsc=$(get_label_vlsc)
page=$(get_page)
page_url=https://massgrave.dev/windows_${page}_links.html
info "Find windows iso"
@ -640,7 +640,7 @@ get_windows_iso_links() {
# en-us_windows_10_iot_enterprise_ltsc_2021_arm64_dvd_e8d4fc46.iso
# en-us_windows_10_iot_enterprise_version_22h2_arm64_dvd_39566b6b.iso
# sed -Ei 和 sed -iE 是不同的
if $is_ltsc; then
if is_ltsc; then
sed -Ei '/ltsc|ltsb/!d' $tmp/win.list
else
sed -Ei '/ltsc|ltsb/d' $tmp/win.list