mirror of
https://github.com/qemus/qemu-docker.git
synced 2025-10-16 20:30:41 +08:00
fix: Avoid pipe to head on find (#751)
This commit is contained in:
1
.github/workflows/build.yml
vendored
1
.github/workflows/build.yml
vendored
@@ -113,5 +113,4 @@ jobs:
|
|||||||
subject: Build of ${{ github.event.repository.name }} v${{ steps.meta.outputs.version }} completed
|
subject: Build of ${{ github.event.repository.name }} v${{ steps.meta.outputs.version }} completed
|
||||||
body: |
|
body: |
|
||||||
The build job of ${{ github.event.repository.name }} v${{ steps.meta.outputs.version }} was completed successfully!
|
The build job of ${{ github.event.repository.name }} v${{ steps.meta.outputs.version }} was completed successfully!
|
||||||
|
|
||||||
See https://github.com/${{ github.repository }}/actions for more information.
|
See https://github.com/${{ github.repository }}/actions for more information.
|
||||||
|
@@ -203,8 +203,8 @@ findFile() {
|
|||||||
local ext="$1"
|
local ext="$1"
|
||||||
local fname="boot.$ext"
|
local fname="boot.$ext"
|
||||||
|
|
||||||
dir=$(find / -maxdepth 1 -type d -iname "$fname" | head -n 1)
|
dir=$(find / -maxdepth 1 -type d -iname "$fname" -print -quit)
|
||||||
[ ! -d "$dir" ] && dir=$(find "$STORAGE" -maxdepth 1 -type d -iname "$fname" | head -n 1)
|
[ ! -d "$dir" ] && dir=$(find "$STORAGE" -maxdepth 1 -type d -iname "$fname" -print -quit)
|
||||||
|
|
||||||
if [ -d "$dir" ]; then
|
if [ -d "$dir" ]; then
|
||||||
if hasDisk; then
|
if hasDisk; then
|
||||||
@@ -213,8 +213,8 @@ findFile() {
|
|||||||
error "The bind $dir maps to a file that does not exist!" && exit 37
|
error "The bind $dir maps to a file that does not exist!" && exit 37
|
||||||
fi
|
fi
|
||||||
|
|
||||||
file=$(find / -maxdepth 1 -type f -iname "$fname" | head -n 1)
|
file=$(find / -maxdepth 1 -type f -iname "$fname" -print -quit)
|
||||||
[ ! -s "$file" ] && file=$(find "$STORAGE" -maxdepth 1 -type f -iname "$fname" | head -n 1)
|
[ ! -s "$file" ] && file=$(find "$STORAGE" -maxdepth 1 -type f -iname "$fname" -print -quit)
|
||||||
|
|
||||||
detectType "$file" && return 0
|
detectType "$file" && return 0
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user