Minor improvements to tmp/update-manifest.sh
This commit is contained in:
1 parent
16473d3633
commit
5e6744b43f
1 file changed
+16
-5
+16
-5
@@ -81,7 +81,7 @@ fi
|
|||||||
|
|
||||||
# first determine if git is executable
|
# first determine if git is executable
|
||||||
if [[ -z "$GIT" || ! -f "$GIT" || ! -x "$GIT" ]]; then
|
if [[ -z "$GIT" || ! -f "$GIT" || ! -x "$GIT" ]]; then
|
||||||
echo "$0: ERROR: git not an executable file: $GIT" 1>&2
|
echo "$0: ERROR: git not a regular executable file: $GIT" 1>&2
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -106,22 +106,33 @@ if ! cd "$TOPDIR"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# I have found problems using git rev-parse to verify that we're in a git repo
|
# I have found problems using git rev-parse to verify that we're in a git repo
|
||||||
# so use git status instead. Plus we need the user to see git status anyway.
|
# plus we need the user to see git status anyway so use git status instead.
|
||||||
"$GIT" status 1>&2
|
if ! "$GIT" status 1>&2; then
|
||||||
status="$?"
|
|
||||||
if [[ "$status" -ne 0 ]]; then
|
|
||||||
echo "$USAGE" 1>&2
|
echo "$USAGE" 1>&2
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "$(basename "$0"): ERROR: ${PWD} is not a git repository" 1>&2
|
echo "$(basename "$0"): ERROR: ${PWD} is not a git repository" 1>&2
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo 1>&2
|
||||||
|
echo "NOTE: manifest.numbers and manifest.csv may be modified here but nothing else" 1>&2
|
||||||
|
echo "may be and no new files may be staged for commit either:" 1>&2
|
||||||
read -r -p "Do you have a clean state from git status (Y/N)? "
|
read -r -p "Do you have a clean state from git status (Y/N)? "
|
||||||
if [[ "$REPLY" != "Y" && "$REPLY" != "y" ]]; then
|
if [[ "$REPLY" != "Y" && "$REPLY" != "y" ]]; then
|
||||||
echo "$0: exiting 4 due to user telling us there's a problem." 1>&2
|
echo "$0: exiting 4 due to user telling us there's a problem." 1>&2
|
||||||
exit 4
|
exit 4
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# ask user if they're on the correct branch
|
||||||
|
#
|
||||||
|
echo "Showing branches: " 1>&2
|
||||||
|
"$GIT" branch 1>&2
|
||||||
|
read -r -p "Are you on the right branch (Y/N)? "
|
||||||
|
if [[ "$REPLY" != "Y" && "$REPLY" != "y" ]]; then
|
||||||
|
echo "$0: exiting 4 due to user telling us there's a problem." 1>&2
|
||||||
|
exit 4
|
||||||
|
fi
|
||||||
|
|
||||||
# now cd to the tmp directory
|
# now cd to the tmp directory
|
||||||
#
|
#
|
||||||
if ! cd tmp; then
|
if ! cd tmp; then
|
||||||
|
|||||||
Reference in new issue
Block a user