From 5ea4a626a683f77b73d4d265251c76886b154f85 Mon Sep 17 00:00:00 2001 From: go2null <1t1is2@gmail.com> Date: Sun, 20 Oct 2019 13:21:40 -0400 Subject: [PATCH] check git submodule status before declaring success --- bin/git-delete-submodule | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/git-delete-submodule b/bin/git-delete-submodule index 7618685..7215287 100755 --- a/bin/git-delete-submodule +++ b/bin/git-delete-submodule @@ -27,5 +27,10 @@ git add .gitmodules # 3. Need to confirm and commit the changes for yourself echo -echo "Now submodule $NAME is deleted." +if git submodule status >/dev/null 2>&1 \ + && ! git submodule status | grep "$NAME"; then + echo "Successfully deleted $NAME." +else + echo "Failed to delete $NAME." 1>&2 && exit 6 +fi echo 'Confirm with `git submodule status` and commit the changes for yourself.'