diff --git a/developer/bin/develop_brew_cask b/developer/bin/develop_brew_cask index def869e986..103564a2bd 100755 --- a/developer/bin/develop_brew_cask +++ b/developer/bin/develop_brew_cask @@ -3,10 +3,18 @@ # develop_brew_cask # +### +### settings +### + set -e # exit on any uncaught error set +o histexpand # don't expand history expressions shopt -s nocasematch # case-insensitive regular expressions +### +### functions +### + warn () { local message="$@" if ! [[ $message =~ "\n"$ ]]; then @@ -53,6 +61,10 @@ create_dev_links () { /bin/ln -s "$git_root/lib" . } +### +### main +### + _develop_brew_cask () { # configurable @@ -83,6 +95,7 @@ _develop_brew_cask () { } +# process args if [[ $1 =~ ^-+h(elp)?$ ]]; then printf "develop_brew_cask @@ -101,6 +114,7 @@ mode is in effect. exit fi +# dispatch main _develop_brew_cask "${@}" # diff --git a/developer/bin/get_release_tag b/developer/bin/get_release_tag index d69c38a07b..d7932f78cc 100755 --- a/developer/bin/get_release_tag +++ b/developer/bin/get_release_tag @@ -3,14 +3,26 @@ # get_release_tag # +### +### settings +### + set -e # exit on any uncaught error set +o histexpand # don't expand history expressions shopt -s nocasematch # case-insensitive regular expressions +### +### global variables +### + opt_next='' opt_latest='' opt_verbose='' +### +### functions +### + warn () { local message="$@" if ! [[ $message =~ "\n"$ ]]; then @@ -146,6 +158,10 @@ See RELEASING.md for more information. done } +### +### main +### + _get_release_tag () { cd_to_project_root local latest_tag="$(git describe --tags --abbrev=0 2>/dev/null)" @@ -169,6 +185,7 @@ _get_release_tag () { process_args "${@}" +# dispatch main _get_release_tag # diff --git a/developer/bin/list_apps_in_pkg b/developer/bin/list_apps_in_pkg index 4e7e536d6d..4d5ece1f73 100755 --- a/developer/bin/list_apps_in_pkg +++ b/developer/bin/list_apps_in_pkg @@ -3,14 +3,26 @@ # list_apps_in_pkg # +### +### settings +### + set -e # exit on any uncaught error set +o histexpand # don't expand history expressions shopt -s nocasematch # case-insensitive regular expressions +### +### global variables +### + opt_lax='' opt_pkg='' tmpdir='' +### +### functions +### + warn () { local message="$@" if ! [[ $message =~ "\n"$ ]]; then @@ -104,6 +116,10 @@ See CONTRIBUTING.md and 'man pkgutil' for more information. fi } +### +### main +### + _list_apps_in_pkg () { tmpdir=`/usr/bin/mktemp -d -t list_apps_in_pkg` @@ -112,7 +128,7 @@ _list_apps_in_pkg () { /usr/sbin/pkgutil --expand "$opt_pkg" "$tmpdir/unpack" { - # strings that look like appnames (Something.app) + # strings that look like App names (Something.app) app_source_1; app_source_2; app_source_3; @@ -126,6 +142,7 @@ _list_apps_in_pkg () { process_args "${@}" +# dispatch main _list_apps_in_pkg # diff --git a/developer/bin/list_ids_in_pkg b/developer/bin/list_ids_in_pkg index 292d942658..a7a2fff687 100755 --- a/developer/bin/list_ids_in_pkg +++ b/developer/bin/list_ids_in_pkg @@ -3,12 +3,24 @@ # list_ids_in_pkg # +### +### settings +### + set -e # exit on any uncaught error set +o histexpand # don't expand history expressions shopt -s nocasematch # case-insensitive regular expressions +### +### global variables +### + tmpdir='' +### +### functions +### + bundle_id_source_1 () { /usr/bin/find "$tmpdir" -name PackageInfo -print0 | \ /usr/bin/xargs -0 /usr/bin/perl -0777 -ne \ @@ -30,6 +42,10 @@ mark_up_sources () { 'printf "{}"; /usr/sbin/pkgutil --pkg-info "{}" >/dev/null 2>&1 && printf " (+)"; printf "\n"' } +### +### main +### + _list_ids_in_pkg () { tmpdir=`/usr/bin/mktemp -d -t list_ids_in_pkg` @@ -47,6 +63,7 @@ _list_ids_in_pkg () { } +# process args if [[ $1 =~ ^-+h(elp)?$ || -z "$1" ]]; then printf "list_ids_in_pkg @@ -76,6 +93,7 @@ See CONTRIBUTING.md and 'man pkgutil' for more information. exit fi +# dispatch main _list_ids_in_pkg "${@}" # diff --git a/developer/bin/list_loaded_kext_ids b/developer/bin/list_loaded_kext_ids index 17e8e44f83..caca550368 100755 --- a/developer/bin/list_loaded_kext_ids +++ b/developer/bin/list_loaded_kext_ids @@ -3,10 +3,18 @@ # list_loaded_kext_ids # +### +### settings +### + set -e # exit on any uncaught error set +o histexpand # don't expand history expressions shopt -s nocasematch # case-insensitive regular expressions +### +### main +### + _list_loaded_kext_ids () { /usr/sbin/kextstat -kl | \ /usr/bin/cut -c53- | \ @@ -14,6 +22,7 @@ _list_loaded_kext_ids () { /usr/bin/egrep -v '^com\.apple\.' } +# process args if [[ $1 =~ ^-+h(elp)?$ ]]; then printf "list_loaded_kext_ids @@ -30,6 +39,7 @@ See CONTRIBUTING.md for more information. exit fi +# dispatch main _list_loaded_kext_ids "${@}" # diff --git a/developer/bin/list_recent_pkg_ids b/developer/bin/list_recent_pkg_ids index 281d9b6b48..e2c16af3a3 100755 --- a/developer/bin/list_recent_pkg_ids +++ b/developer/bin/list_recent_pkg_ids @@ -3,10 +3,18 @@ # list_recent_pkg_ids # +### +### settings +### + set -e # exit on any uncaught error set +o histexpand # don't expand history expressions shopt -s nocasematch # case-insensitive regular expressions +### +### main +### + _list_recent_pkg_ids () { /bin/ls -t /var/db/receipts | \ /usr/bin/egrep '\.plist$' | \ @@ -15,6 +23,7 @@ _list_recent_pkg_ids () { /usr/bin/head -10 } +# process args if [[ $1 =~ ^-+h(elp)?$ ]]; then printf "list_recent_pkg_ids @@ -31,6 +40,7 @@ See CONTRIBUTING.md for more information. exit fi +# dispatch main _list_recent_pkg_ids "${@}" # diff --git a/developer/bin/production_brew_cask b/developer/bin/production_brew_cask index 1fca9b0f3b..ba762686d7 100755 --- a/developer/bin/production_brew_cask +++ b/developer/bin/production_brew_cask @@ -3,10 +3,18 @@ # production_brew_cask # +### +### settings +### + set -e # exit on any uncaught error set +o histexpand # don't expand history expressions shopt -s nocasematch # case-insensitive regular expressions +### +### functions +### + warn () { local message="$@" if ! [[ $message =~ "\n"$ ]]; then @@ -50,6 +58,10 @@ remove_dev_links () { /bin/mv production_Casks Casks } +### +### main +### + _production_brew_cask () { # configurable @@ -80,6 +92,7 @@ _production_brew_cask () { } +# process args if [[ $1 =~ ^-+h(elp)?$ ]]; then printf "production_brew_cask @@ -93,6 +106,7 @@ After running this command it is safe to run 'brew update'. exit fi +# dispatch main _production_brew_cask "${@}" # diff --git a/developer/bin/project_stats b/developer/bin/project_stats index 0dc9d4f118..6e96ee91c0 100755 --- a/developer/bin/project_stats +++ b/developer/bin/project_stats @@ -5,10 +5,18 @@ # stats on project/release from git database # +### +### settings +### + set -e # exit on any uncaught error set +o histexpand # don't expand history expressions shopt -s nocasematch # case-insensitive regular expressions +### +### functions +### + warn () { local message="$@" if ! [[ $message =~ "\n"$ ]]; then @@ -49,6 +57,10 @@ verify_git_object () { fi } +### +### main +### + _homebrew_cask_project_stats () { local initial_commit="5a0d1d5556e3f963a0d34da46e16ecffa59ea2fc" @@ -115,6 +127,7 @@ _homebrew_cask_project_stats () { } +# process args if [[ $1 =~ ^-+h(elp)?$ ]]; then printf "project_stats [ ] @@ -130,6 +143,7 @@ Without argument, show statistics since first commit. exit fi +# dispatch main _homebrew_cask_project_stats "${@}" #