wrapQtAppsHook: actually use makeQtWrapper for symlinks

Since -f implies -h, -h needs to be checked first.
This commit is contained in:
Lin Jian
2025-02-18 19:11:42 +08:00
parent d4b7bd6f6f
commit 7712700b18
2 changed files with 9 additions and 9 deletions

View File

@@ -87,16 +87,16 @@ wrapQtAppsHook() {
do
isELF "$file" || isMachO "$file" || continue
if [ -f "$file" ]
then
echo "wrapping $file"
wrapQtApp "$file"
elif [ -h "$file" ]
if [ -h "$file" ]
then
target="$(readlink -e "$file")"
echo "wrapping $file -> $target"
rm "$file"
makeQtWrapper "$target" "$file"
elif [ -f "$file" ]
then
echo "wrapping $file"
wrapQtApp "$file"
fi
done
done

View File

@@ -81,14 +81,14 @@ if [[ -z "${__nix_wrapQtAppsHook-}" ]]; then
[ -d "$targetDir" ] || continue
find "$targetDir" ! -type d -executable -print0 | while IFS= read -r -d '' file; do
if [ -f "$file" ]; then
echo "wrapping $file"
wrapQtApp "$file"
elif [ -h "$file" ]; then
if [ -h "$file" ]; then
target="$(readlink -e "$file")"
echo "wrapping $file -> $target"
rm "$file"
makeQtWrapper "$target" "$file"
elif [ -f "$file" ]; then
echo "wrapping $file"
wrapQtApp "$file"
fi
done
done