mirror of
https://github.com/wavetermdev/homebrew-cask.git
synced 2026-08-05 13:43:24 -07:00
quoting/stdization/full-paths
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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}';
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ shopt -s nocasematch # case-insensitive regular expressions
|
||||
###
|
||||
|
||||
appdir=''
|
||||
scriptdir="$(dirname '$0')"
|
||||
scriptdir="$(dirname "$0")"
|
||||
|
||||
###
|
||||
### functions
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user