Skip to content

Commit

Permalink
core: 修复因 subshell 导致变量丢失,从而重复运行 virt-what
Browse files Browse the repository at this point in the history
  • Loading branch information
bin456789 committed Oct 14, 2024
1 parent 89800f1 commit d8692e7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions trans.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3809,6 +3809,12 @@ install_windows() {
mkdir -p "$drv" # 驱动下载临时文件夹
mkdir -p "/wim/drivers" # boot.wim 驱动文件夹

# 这里有坑
# $(get_cloud_vendor) 调用了 cache_dmi_and_virt
# 但是 $(get_cloud_vendor) 运行在 subshell 里面
# subshell 运行结束后里面的变量就消失了
# 因此先运行 cache_dmi_and_virt
cache_dmi_and_virt
vendor="$(get_cloud_vendor)"

# virtio
Expand Down

0 comments on commit d8692e7

Please sign in to comment.