quoting/stdization/full-paths

This commit is contained in:
Roland Walker
2014-02-07 11:01:50 -05:00
parent e28cb268a8
commit 8d9ae53217
7 changed files with 37 additions and 13 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ die () {
}
cd_to_project_root () {
local script_dir="$(/usr/bin/dirname $0)"
local script_dir="$(/usr/bin/dirname "$0")"
cd "$script_dir"
local git_root="$(git rev-parse --show-toplevel)"
if [[ -z "$git_root" ]]; then
+31 -7
View File
@@ -5,22 +5,46 @@
# This is temporary, should be replaced with a Rakefile target
#
set -e; # exit on uncaught error
set +o histexpand; # don't expand history expressions
shopt -s nocasematch; # case-insensitive regular expressions
###
### settings
###
set -e # exit on 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
message="${message}\n"
fi
printf "$message" 1>&2
}
die () {
warn "$@"
exit 1
}
cd_to_project_root () {
local script_dir="$(/usr/bin/dirname $0)"
local script_dir="$(/usr/bin/dirname "$0")"
cd "$script_dir"
local git_root="$(git rev-parse --show-toplevel)"
if [[ -z "$git_root" ]]; then
printf "Could not find git project root"
exit 1;
die "ERROR: Could not find git project root"
fi
cd "$git_root"
}
cd_to_project_root;
###
### main
###
cd_to_project_root
ronn --roff --pipe --organization='Homebrew-cask' --manual='brew-cask' doc/src/brew-cask.1.md > doc/man/brew-cask.1
+1 -1
View File
@@ -37,7 +37,7 @@ die () {
}
cd_to_project_root () {
local script_dir="$(/usr/bin/dirname $0)"
local script_dir="$(/usr/bin/dirname "$0")"
cd "$script_dir"
local git_root="$(git rev-parse --show-toplevel)"
if [[ -z "$git_root" ]]; then
+1 -1
View File
@@ -61,7 +61,7 @@ app_source_4 () {
app_source_5 () {
/usr/bin/find "$pkgdir" -name Archive.pax.gz -print0 | \
/usr/bin/xargs -0 -n1 -I{} sh -c \
/usr/bin/xargs -0 -n1 -I{} /bin/bash -c \
"/usr/bin/gunzip -c '{}' | /bin/pax | /usr/bin/egrep '\.app'" | \
/usr/bin/perl -pe 's{\A.*/([^/]+\.app).*\Z}{$1}';
}
+1 -1
View File
@@ -16,7 +16,7 @@ shopt -s nocasematch # case-insensitive regular expressions
###
appdir=''
scriptdir="$(dirname '$0')"
scriptdir="$(dirname "$0")"
###
### functions
+1 -1
View File
@@ -35,7 +35,7 @@ die () {
}
cd_to_project_root () {
local script_dir="$(/usr/bin/dirname $0)"
local script_dir="$(/usr/bin/dirname "$0")"
cd "$script_dir"
local git_root="$(git rev-parse --show-toplevel)"
if [[ -z "$git_root" ]]; then
+1 -1
View File
@@ -47,7 +47,7 @@ die () {
}
cd_to_project_root () {
local script_dir="$(/usr/bin/dirname $0)"
local script_dir="$(/usr/bin/dirname "$0")"
cd "$script_dir"
local git_root="$(git rev-parse --show-toplevel)"
if [[ -z "$git_root" ]]; then