Recently I've found it handy to know where I am when the various commands complain about an invalid source directory.
So I've added slightly more detail to the resulting error message. Odds are it shouldn't bug any existing tools and help with troubleshooting mass commands.
Pat Riehecky (1): Better error reporting on invalid dirs
get_sources.sh | 3 ++- into_srpm.sh | 3 ++- return_disttag.sh | 3 ++- show_possible_srpms.sh | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-)
--- get_sources.sh | 3 ++- into_srpm.sh | 3 ++- return_disttag.sh | 3 ++- show_possible_srpms.sh | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/get_sources.sh b/get_sources.sh index 0a22451..77dfd4a 100755 --- a/get_sources.sh +++ b/get_sources.sh @@ -152,7 +152,8 @@ pn=${meta%.metadata} pn=${pn#.}
if [ ! -d .git ] || [ ! -d SPECS ]; then - echo 'You need to run this from inside a sources git repo' >&2 + thisdir=$(pwd) + echo "${thisdir}: You need to run this from inside a sources git repo" >&2 exit 1 fi mkdir -p SOURCES diff --git a/into_srpm.sh b/into_srpm.sh index 5399dc9..a47f6f4 100755 --- a/into_srpm.sh +++ b/into_srpm.sh @@ -107,7 +107,8 @@ while [[ 0 -eq 0 ]]; do done
if [[ ! -d .git ]] || [[ ! -d SPECS ]]; then - echo 'You need to run this from inside a sources git repo' >&2 + thisdir=$(pwd) + echo "${thisdir}: You need to run this from inside a sources git repo" >&2 exit 1 fi
diff --git a/return_disttag.sh b/return_disttag.sh index 0048cd6..c390343 100755 --- a/return_disttag.sh +++ b/return_disttag.sh @@ -72,7 +72,8 @@ warn () { }
if [[ ! -d .git ]] || [[ ! -d SPECS ]]; then - echo 'You need to run this from inside a sources git repo' >&2 + thisdir=$(pwd) + echo "${thisdir}: You need to run this from inside a sources git repo" >&2 exit 1 fi
diff --git a/show_possible_srpms.sh b/show_possible_srpms.sh index 83c4d08..f357d7d 100755 --- a/show_possible_srpms.sh +++ b/show_possible_srpms.sh @@ -93,7 +93,8 @@ while [[ 0 -eq 0 ]]; do done
if [[ ! -d .git ]] || [[ ! -d SPECS ]]; then - echo 'You need to run this from inside a sources git repo' >&2 + thisdir=$(pwd) + echo "${thisdir}: You need to run this from inside a sources git repo" >&2 exit 1 fi