mirror of
https://github.com/SHC-ASTRA/rover-ros2.git
synced 2026-04-20 11:51:16 -05:00
fix a handful of oversights in the anchor refactor. add a testing script
This commit is contained in:
38
scripts/reset-repo.bash
Executable file
38
scripts/reset-repo.bash
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
repo_root="$(git rev-parse --show-toplevel)"
|
||||
|
||||
if [[ -z $repo_root ]]; then
|
||||
echo "script must be run from within the rover-ros2 repo" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd $repo_root
|
||||
|
||||
echo "this will nuke all of your current un-commited git changes, including any changes to submodules and any gitignored files. is this okay? (y/N)"
|
||||
read okay
|
||||
|
||||
if [[ ! "$okay" = "y" ]]; then
|
||||
echo "you didn't say exactly 'y'. aborting." >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
echo
|
||||
|
||||
echo "ok say goodbye to everything in this repo"
|
||||
git submodule deinit --all -f && echo "- submodules gone"
|
||||
git clean -fdx && echo "- gitignored changes gone"
|
||||
git add -A
|
||||
git reset HEAD --hard && echo "- everything else gone"
|
||||
echo
|
||||
|
||||
echo "in theory that should've done it. let's make sure"
|
||||
status=$(git status --porcelain)
|
||||
echo $status
|
||||
if [[ -z $status ]]; then
|
||||
echo "nice, all clean!"
|
||||
else
|
||||
echo "uhh that's not supposed to be there. this is probably a bug in this script. good luck!" >&2
|
||||
exit 3
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user