fix: Avoid pipe to head on find (#751)

This commit is contained in:
Felipe Franciosi
2025-04-09 06:43:41 +01:00
committed by GitHub
parent ddd38dcd0b
commit 433265fa2e
10 changed files with 38 additions and 39 deletions

View File

@@ -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.

View File

@@ -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