completions/java_home: fix version completion due to change of osascript default output

Apparently the last expression outputs to stdout.

Closes #11743
This commit is contained in:
Johannes Altmanninger
2025-08-27 09:26:17 +02:00
parent f843d5bd34
commit c0c9245d99

View File

@@ -1,6 +1,6 @@
function __fish_complete_macos_java_version
set -l json (/usr/libexec/java_home -X|plutil -convert json -o - -)
osascript -l JavaScript -s o -e "JSON.parse('$json').forEach(e => console.log(`\${e.JVMVersion}\t\${e.JVMArch} \${e.JVMName} by--exec \${e.JVMVendor}`))"
osascript -l JavaScript -s o -e "JSON.parse('$json').map(e => `\${e.JVMVersion}\t\${e.JVMArch} \${e.JVMName} by \${e.JVMVendor}`).join('\n')"
end
function __fish_complete_macos_java_home_exec