devscript: comments

This commit is contained in:
Roland Walker
2014-01-31 12:33:30 -05:00
parent 26d4f804d8
commit bf19f020d6
8 changed files with 115 additions and 1 deletions
+14
View File
@@ -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 "${@}"
#
+17
View File
@@ -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
#
+18 -1
View File
@@ -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
#
+18
View File
@@ -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 <file.pkg>
@@ -76,6 +93,7 @@ See CONTRIBUTING.md and 'man pkgutil' for more information.
exit
fi
# dispatch main
_list_ids_in_pkg "${@}"
#
+10
View File
@@ -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 "${@}"
#
+10
View File
@@ -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 "${@}"
#
+14
View File
@@ -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 "${@}"
#
+14
View File
@@ -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 [ <commit-object> ]
@@ -130,6 +143,7 @@ Without argument, show statistics since first commit.
exit
fi
# dispatch main
_homebrew_cask_project_stats "${@}"
#