Skip to content

Instantly share code, notes, and snippets.

@karlcow

karlcow/bv.sh Secret

Last active June 9, 2022 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karlcow/b1d992df616bc6f4397fa96035731a20 to your computer and use it in GitHub Desktop.
Save karlcow/b1d992df616bc6f4397fa96035731a20 to your computer and use it in GitHub Desktop.
collect the version numbers of browsers
#!/bin/zsh
APP_PATH="/Applications/"
INFO_PATH=".app/Contents/Info.plist"
browsers=("Safari Technology Preview" "Firefox Nightly" "Google Chrome Canary" "Safari" "Firefox" "Google Chrome" "Microsoft Edge Canary")
for browser_name in ${(@k)browsers}; do
full_path="${APP_PATH}${browser_name}${INFO_PATH}" ;
if test -f "$full_path"; then
browser_version=$(defaults read "$full_path" CFBundleShortVersionString);
echo "${browser_name} ${browser_version}";
fi
done
@karlcow
Copy link
Author

karlcow commented Jun 8, 2022

The result will be something like:

Safari Technology Preview 15.4
Google Chrome Canary 104.0.5107.0
Firefox Nightly 103.0a1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment