diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2016-11-07 05:27:43 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2016-11-07 05:27:43 +0300 |
commit | dbbd2e1c6583f33c31e3e4605bc640879740a45d (patch) | |
tree | e471f8abaf6534425add7df16d04bed157c3731a /%HOME%/.bash_utils | |
parent | list_repo_*: replace with simple aliases (diff) | |
download | linux-home-dbbd2e1c6583f33c31e3e4605bc640879740a45d.tar.gz linux-home-dbbd2e1c6583f33c31e3e4605bc640879740a45d.zip |
bugfix & code style
Diffstat (limited to '%HOME%/.bash_utils')
-rw-r--r-- | %HOME%/.bash_utils/cxx.sh | 4 | ||||
-rw-r--r-- | %HOME%/.bash_utils/distr.sh | 2 | ||||
-rw-r--r-- | %HOME%/.bash_utils/path.sh | 2 | ||||
-rw-r--r-- | %HOME%/.bash_utils/text.sh | 12 |
4 files changed, 10 insertions, 10 deletions
diff --git a/%HOME%/.bash_utils/cxx.sh b/%HOME%/.bash_utils/cxx.sh index 4ff81f4..7fb9714 100644 --- a/%HOME%/.bash_utils/cxx.sh +++ b/%HOME%/.bash_utils/cxx.sh @@ -72,7 +72,7 @@ runc() ( local build_dir build_dir="$( mktemp --directory )" - trap "$( printf 'popd > /dev/null && rm -rf -- %q' "$build_dir" )" 0 + trap "$( printf -- 'popd > /dev/null && rm -rf -- %q' "$build_dir" )" 0 pushd "$build_dir" > /dev/null local output_name @@ -152,7 +152,7 @@ runcxx() ( local build_dir build_dir="$( mktemp --directory )" - trap "$( printf 'popd > /dev/null && rm -rf -- %q' "$build_dir" )" 0 + trap "$( printf -- 'popd > /dev/null && rm -rf -- %q' "$build_dir" )" 0 pushd "$build_dir" > /dev/null local output_name diff --git a/%HOME%/.bash_utils/distr.sh b/%HOME%/.bash_utils/distr.sh index 799f52f..252f86c 100644 --- a/%HOME%/.bash_utils/distr.sh +++ b/%HOME%/.bash_utils/distr.sh @@ -75,7 +75,7 @@ sums_update_distr() ( while IFS= read -d '' -r path; do paths+=("$path") - done < <( find . -type f -\( -iname '*.exe' -o -iname '*.iso' -\) -printf '%P\0' ) + done < <( find -type f -\( -iname '*.exe' -o -iname '*.iso' -\) -printf '%P\0' ) sums_update ${paths[@]+"${paths[@]}"} ) diff --git a/%HOME%/.bash_utils/path.sh b/%HOME%/.bash_utils/path.sh index 4aff550..13b5b00 100644 --- a/%HOME%/.bash_utils/path.sh +++ b/%HOME%/.bash_utils/path.sh @@ -21,7 +21,7 @@ add_missing_path() ( for path; do if str_contains "$path" ':'; then - echo "${FUNCNAME[0]}: mustn't contain colons: $path" >&2 + echo "${FUNCNAME[0]}: mustn't contain colon (':') characters: $path" >&2 return 1 fi done diff --git a/%HOME%/.bash_utils/text.sh b/%HOME%/.bash_utils/text.sh index 242837f..aefe453 100644 --- a/%HOME%/.bash_utils/text.sh +++ b/%HOME%/.bash_utils/text.sh @@ -81,13 +81,13 @@ str_starts_with() ( if [ "$#" -ne 2 ]; then echo "usage: ${FUNCNAME[0]} STR SUB" return 1 - fi + fi - local str="$1" - local sub - sub="$( printf -- '%q' "$2" )" + local str="$1" + local sub + sub="$( printf -- '%q' "$2" )" - test "$str" != "${str#$sub}" + test "$str" != "${str#$sub}" ) str_split() ( @@ -136,7 +136,7 @@ str_split() ( IFS="$old_delim" read -a xs -r <<< "$str" for x in ${xs[@]+"${xs[@]}"}; do - printf "$fmt" "$x" + printf -- "$fmt" "$x" done ) |