Last active
April 5, 2017 18:27
-
-
Save shirohana/c82a329a27a4433e75f4d7273ee68fc8 to your computer and use it in GitHub Desktop.
Simple shell script to drop the specified yarn cache
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
REMOVE_DIRS=$(ls -d $(yarn cache dir)/* | grep $@) | |
if [ -z REMOVE_DIRS ]; then | |
echo Empty | |
else | |
for dir in $REMOVE_DIRS; do | |
read -p "rm -rf $dir? " -n 1 -r | |
echo # Present a newline | |
if [[ $REPLY =~ ^[Yy]$ ]]; then | |
rm -rf $dir | |
fi | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment