mirror of
https://github.com/dockur/windows.git
synced 2025-10-29 12:15:50 +00:00
feat: Ignore case in ISO filename
This commit is contained in:
parent
f8cff00334
commit
621206a040
1 changed files with 8 additions and 13 deletions
|
|
@ -187,28 +187,23 @@ abortInstall() {
|
||||||
|
|
||||||
detectCustom() {
|
detectCustom() {
|
||||||
|
|
||||||
local file=""
|
local file
|
||||||
local size base
|
|
||||||
|
|
||||||
CUSTOM=""
|
file=$(find / -maxdepth 1 -type f -iname custom.iso | head -n 1)
|
||||||
|
[ ! -s "$file" ] && file=$(find "$STORAGE" -maxdepth 1 -type f -iname custom.iso | head -n 1)
|
||||||
|
|
||||||
if [[ "${VERSION,,}" != "http"* ]]; then
|
if [ ! -s "$file" ] && [[ "${VERSION,,}" != "http"* ]]; then
|
||||||
base="${VERSION/\/storage\//}"
|
local base=$(basename "$VERSION")
|
||||||
[[ "$base" == "."* ]] && base="${file:1}"
|
file=$(find "$STORAGE" -maxdepth 1 -type f -iname "$base" | head -n 1)
|
||||||
[[ "$base" == *"/"* ]] && base=""
|
|
||||||
[ -n "$base" ] && file=$(find "$STORAGE" -maxdepth 1 -type f -iname "$base" | head -n 1)
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -z "$file" ] && file=$(find "$STORAGE" -maxdepth 1 -type f -iname custom.iso | head -n 1)
|
CUSTOM=""
|
||||||
[ -z "$file" ] && file=$(find "$STORAGE" -maxdepth 1 -type f -iname custom.img | head -n 1)
|
|
||||||
|
|
||||||
base="/custom.iso"
|
|
||||||
[ -f "$base" ] && [ -s "$base" ] && file="$base"
|
|
||||||
|
|
||||||
if [ ! -f "$file" ] || [ ! -s "$file" ]; then
|
if [ ! -f "$file" ] || [ ! -s "$file" ]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
local size
|
||||||
size="$(stat -c%s "$file")"
|
size="$(stat -c%s "$file")"
|
||||||
[ -z "$size" ] || [[ "$size" == "0" ]] && return 0
|
[ -z "$size" ] || [[ "$size" == "0" ]] && return 0
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue