Skip to content

Commit

Permalink
🐛 fix(clean): exit made clean abort prematurly
Browse files Browse the repository at this point in the history
  • Loading branch information
make-github-pseudonymous-again committed Aug 19, 2018
1 parent adec1e9 commit ba1f21e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions bootstrap/clean
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ arch_packages="$(sed -e 's/\s*#.*$//g' -e '/^$/d' "$DOTFILES"/bootstrap/obsolete
node_packages="$(sed -e 's/\s*#.*$//g' -e '/^$/d' "$DOTFILES"/bootstrap/obsolete/node)"
pip_packages="$(sed -e 's/\s*#.*$//g' -e '/^$/d' "$DOTFILES"/bootstrap/obsolete/pip)"


if command -v pip 1>/dev/null; then
pip_installed="$(pip list --format freeze | cut -d'=' -f1)"

function _p ( ) {
pacman_name="$1"
pip_name="$(sed 's/^python-//g' <<< "$pacman_name")"
if { <<< "$pacman_installed" grep "^$pacman_name\$" 1>/dev/null 2>&1 ; } ; then
exit
return
fi
if { <<< "$pip_installed" grep "^$pip_name\$" 1>/dev/null 2>&1 ; } ; then
pip uninstall "$pip_name"
Expand All @@ -40,7 +39,7 @@ if command -v npm 1>/dev/null; then

function _n ( ) {
if { <<< "$pacman_installed" grep "^$1\$" 1>/dev/null 2>&1 ; } ; then
exit
return
fi
if { <<< "$npm_installed" grep "^$1\$" 1>/dev/null 2>&1 ; } ; then
npm uninstall -g "$1"
Expand All @@ -60,7 +59,7 @@ if command -v yarn 1>/dev/null; then

function _y ( ) {
if { <<< "$pacman_installed" grep "^$1\$" 1>/dev/null 2>&1 ; } ; then
exit
return
fi
if { <<< "$yarn_installed" grep "^$1\$" 1>/dev/null 2>&1 ; } ; then
yarn global remove "$1"
Expand Down

0 comments on commit ba1f21e

Please sign in to comment.