github.com/ddev/ddev@v1.23.2-0.20240519125000-d824ffe36ff3/scripts/docker-desktop-version.sh (about)

     1  #!/bin/bash
     2  
     3  MACOS_INFO_PATH=/Applications/Docker.app/Contents/Info.plist
     4  
     5  if command -v powershell >/dev/null; then
     6    printf "Docker Desktop for Windows "
     7    powershell.exe -command '[System.Diagnostics.FileVersionInfo]::GetVersionInfo("C:\Program Files\Docker\Docker\Docker Desktop.exe").FileVersion'
     8  elif [ -x /usr/libexec/PlistBuddy ] ; then
     9    version=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" ${MACOS_INFO_PATH})
    10    build=$(/usr/libexec/PlistBuddy -c "Print :CFBundleVersion" ${MACOS_INFO_PATH})
    11    printf "Docker Desktop for Mac %s build %s" ${version} ${build}
    12  else
    13    printf "Unknown Docker Desktop version"
    14  fi