Make shellcheck happier
This commit is contained in:
@@ -16,10 +16,10 @@ OPERATING_SYSTEM=$(get_os)
|
|||||||
|
|
||||||
# For a given file, return its corresponding project root.
|
# For a given file, return its corresponding project root.
|
||||||
function project_root() {
|
function project_root() {
|
||||||
pushd $(dirname "$1") 2>&1 >/dev/null
|
pushd "$(dirname "$1")" >/dev/null 2>&1 || exit 101
|
||||||
out=$(git rev-parse --show-toplevel)
|
out=$(git rev-parse --show-toplevel)
|
||||||
ret="$?"
|
ret="$?"
|
||||||
popd 2>&1 >/dev/null
|
popd >/dev/null 2>&1 || exit 1
|
||||||
|
|
||||||
if [[ "$ret" != "0" ]]; then
|
if [[ "$ret" != "0" ]]; then
|
||||||
echo -n ""
|
echo -n ""
|
||||||
@@ -35,12 +35,12 @@ function project_root() {
|
|||||||
wf_root() {
|
wf_root() {
|
||||||
arg=$(pwd)/bin/would-reformat.sh
|
arg=$(pwd)/bin/would-reformat.sh
|
||||||
|
|
||||||
pr=$(project_root $arg)
|
pr=$(project_root "$arg")
|
||||||
|
|
||||||
link="$pr/bin/would-reformat.sh"
|
link="$pr/bin/would-reformat.sh"
|
||||||
|
|
||||||
original0=$(resolve_symlink "$link")
|
original0=$(resolve_symlink "$link")
|
||||||
original=$(normalize_dir_of_file $original0)
|
original=$(normalize_dir_of_file "$original0")
|
||||||
|
|
||||||
out="$original"
|
out="$original"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user