refactor: 调整代码顺序

This commit is contained in:
Olia Lisa
2026-07-24 11:14:42 +08:00
parent a9b7f09e06
commit cfd573c5c8
3 changed files with 10 additions and 13 deletions
+3 -3
View File
@@ -154,9 +154,6 @@ build() {
}
project_dir="$(cd "$(dirname "$0")" && pwd)"
cd "$project_dir"
# 要构建的 ImmortalWrt 版本, 可以在 https://github.com/immortalwrt/immortalwrt 查询版本号
default_version="25.12.1"
version=$(ask_input "请输入 ImmortalWrt 版本" "$default_version")
@@ -165,6 +162,9 @@ version=$(ask_input "请输入 ImmortalWrt 版本" "$default_version")
default_lan_ip="192.168.1.1"
lan_ip=$(input_lan_ip "$default_lan_ip")
project_dir="$(cd "$(dirname "$0")" && pwd)"
cd "$project_dir"
install_dependencies
builder_dir="$(download_imagebuilder "$version")"
+3 -5
View File
@@ -155,11 +155,6 @@ build() {
}
project_dir="$(cd "$(dirname "$0")" && pwd)"
cd "$project_dir"
# 要构建的 ImmortalWrt 版本, 可以在 https://github.com/immortalwrt/immortalwrt 查询版本号
default_version="25.12.1"
version=$(ask_input "请输入 ImmortalWrt 版本" "$default_version")
@@ -168,6 +163,9 @@ version=$(ask_input "请输入 ImmortalWrt 版本" "$default_version")
default_lan_ip="192.168.1.1"
lan_ip=$(input_lan_ip "$default_lan_ip")
project_dir="$(cd "$(dirname "$0")" && pwd)"
cd "$project_dir"
# 安装依赖
install_dependencies
+4 -5
View File
@@ -199,11 +199,6 @@ build(){
fi
}
# 项目根目录,保证从任意位置执行 r2s.sh 都能找到其他资源
project_dir="$(cd "$(dirname "$0")" && pwd)"
cd "$project_dir"
# 要构建的 ImmortalWrt 版本, 可以在 https://github.com/immortalwrt/immortalwrt 查询版本号
default_version="25.12.1"
version=$(ask_input "请输入 ImmortalWrt 版本" "$default_version")
@@ -212,6 +207,10 @@ version=$(ask_input "请输入 ImmortalWrt 版本" "$default_version")
default_rootfs_partsize="600"
rootfs_partsize=$(ask_input "请输入根分区大小(MB)" "$default_rootfs_partsize")
# 项目根目录,保证从任意位置执行 r2s.sh 都能找到其他资源
project_dir="$(cd "$(dirname "$0")" && pwd)"
cd "$project_dir"
# lan口ip
default_lan_ip="192.168.1.1"
lan_ip=$(input_lan_ip "$default_lan_ip")