Last active
August 12, 2016 04:52
-
-
Save smj10j/b4e6a17a484eb3cba2c7 to your computer and use it in GitHub Desktop.
Quick exraction speed test for archive applications on OSX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ######################################## | |
| # Tests zip capabilities of given apps # | |
| ######################################## | |
| if [[ "$#" == 0 ]]; then | |
| echo "Usage: $0 [directory] [apps...]" | |
| exit 1 | |
| fi | |
| DIR=$(readlink -e "${1:-~/Downloads/}") | |
| if [[ ! -d "$DIR" ]]; then | |
| echo "Invalid directory '$1'" | |
| exit 1 | |
| else | |
| shift | |
| APPS=( ${@:-'Archive Utility' 'BetterZip' 'The Unarchiver'} ) | |
| fi | |
| echo "Using dir $DIR" | |
| echo "Testing apps ${APPS[@]}" | |
| echo "" | |
| for APP in "${APPS[@]}"; do | |
| echo "Testing $APP..." | |
| time open --wait-apps --background -a "$APP" --args "$DIR"/*.zip | |
| find "$DIR"/* -maxdepth 0 -type d -exec rm -rf {} \; 2>/dev/null | |
| echo "" | |
| echo "" | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment