feat: update git-clean syntax
This commit is contained in:
parent
51f3ed41cc
commit
2e0927fc93
1 changed files with 9 additions and 5 deletions
|
@ -17,8 +17,10 @@ in
|
||||||
echo "Could not parse filter string"
|
echo "Could not parse filter string"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
#echo "Checking git-cleanliness at $repo_dir, working in $PWD"
|
||||||
cd "$repo_dir" || return
|
cd "$repo_dir" || return
|
||||||
inside_git_repo="$(${git}/bin/git rev-parse --is-inside-work-tree 2>/dev/null)"
|
inside_git_repo="$(${git}/bin/git rev-parse --is-inside-work-tree 2>/dev/null)"
|
||||||
|
result=256
|
||||||
if [ "$inside_git_repo" ]; then
|
if [ "$inside_git_repo" ]; then
|
||||||
if [ "$(${git}/bin/git status --porcelain)" ]; then
|
if [ "$(${git}/bin/git status --porcelain)" ]; then
|
||||||
result=0
|
result=0
|
||||||
|
@ -30,6 +32,10 @@ in
|
||||||
if [ "$filter" = "dirty" ]; then
|
if [ "$filter" = "dirty" ]; then
|
||||||
if [[ $result -eq 0 ]]; then
|
if [[ $result -eq 0 ]]; then
|
||||||
echo "DIRTY $PWD"
|
echo "DIRTY $PWD"
|
||||||
|
read -rp "Enter dirty directory? [y/N] " userinput
|
||||||
|
if [[ "$userinput" = "y" ]]; then
|
||||||
|
$SHELL
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [[ $result -eq 1 ]]; then
|
if [[ $result -eq 1 ]]; then
|
||||||
|
@ -39,10 +45,8 @@ in
|
||||||
#echo "going back to $prev"
|
#echo "going back to $prev"
|
||||||
cd "$prev" || return
|
cd "$prev" || return
|
||||||
}
|
}
|
||||||
export -f git_check
|
|
||||||
export -f cd_err
|
|
||||||
path=$PWD
|
path=$PWD
|
||||||
for item in $(${pkgs.findutils}/bin/find . -maxdepth 1 -type d); do
|
for item in $(find . -maxdepth 1 -type d); do
|
||||||
git_check "$path" "$item" "$1"
|
git_check "$path" "$item" "$1"
|
||||||
done
|
done
|
||||||
''
|
''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue