Chore/update clear script
This commit is contained in:
+32
-23
@@ -10,22 +10,31 @@ then
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "\x1b[35;01m""Do you want to clear general cache(y/n)?""\x1b[39;49;00m"
|
||||
read cache
|
||||
|
||||
echo "\x1b[35;01m""Do you want to re-install project libraries(y/n)?""\x1b[39;49;00m"
|
||||
read libraries
|
||||
|
||||
echo "\x1b[35;01m""Do you want to clear ios project(y/n)?""\x1b[39;49;00m"
|
||||
read ios
|
||||
|
||||
echo "\x1b[35;01m""Do you want to clear android project(y/n)?""\x1b[39;49;00m"
|
||||
read android
|
||||
|
||||
echo "\x1b[35;01m""Do you want to clear general cache(y/n)?""\x1b[39;49;00m"
|
||||
read cache
|
||||
|
||||
echo "\x1b[35;01m""Do you want to re-install project libraries?""\x1b[39;49;00m"
|
||||
read libraries
|
||||
else
|
||||
while [[ $# -gt 0 ]]; do
|
||||
key="$1"
|
||||
|
||||
case $key in
|
||||
cache)
|
||||
cache="y"
|
||||
shift
|
||||
;;
|
||||
npm)
|
||||
libraries="y"
|
||||
shift
|
||||
;;
|
||||
ios)
|
||||
ios="y"
|
||||
shift
|
||||
@@ -34,11 +43,10 @@ else
|
||||
android="y"
|
||||
shift
|
||||
;;
|
||||
cache)
|
||||
all)
|
||||
ios="y"
|
||||
android="y"
|
||||
cache="y"
|
||||
shift
|
||||
;;
|
||||
npm)
|
||||
libraries="y"
|
||||
shift
|
||||
;;
|
||||
@@ -49,29 +57,30 @@ else
|
||||
done
|
||||
fi
|
||||
|
||||
echo "ios " $ios
|
||||
echo "android " $android
|
||||
echo "\x1b[35;01m""Clearing of the following components is starting...""\x1b[39;49;00m"
|
||||
echo "cache " $cache
|
||||
echo "npm " $libraries
|
||||
|
||||
if [[ $ios == "y" ]] || [[ $1 == "all" ]];
|
||||
then
|
||||
. scripts/clear-ios.sh
|
||||
fi
|
||||
|
||||
if [[ $android == "y" ]] || [[ $1 == "all" ]];
|
||||
then
|
||||
. scripts/clear-android.sh
|
||||
fi
|
||||
echo "ios " $ios
|
||||
echo "android " $android
|
||||
|
||||
if [[ $cache == "y" ]] || [[ $1 == "all" ]];
|
||||
then
|
||||
. scripts/clear-cache.sh
|
||||
. scripts/clear-cache.sh || true
|
||||
fi
|
||||
|
||||
if [[ $libraries == "y" ]] || [[ $1 == "all" ]];
|
||||
then
|
||||
. scripts/reinstall-project.sh
|
||||
. scripts/reinstall-project.sh || true
|
||||
fi
|
||||
|
||||
if [[ $ios == "y" ]] || [[ $1 == "all" ]];
|
||||
then
|
||||
. scripts/clear-ios.sh || true
|
||||
fi
|
||||
|
||||
if [[ $android == "y" ]] || [[ $1 == "all" ]];
|
||||
then
|
||||
. scripts/clear-android.sh || true
|
||||
fi
|
||||
|
||||
echo "\x1b[35;01m""Clearing is completed. You're ready to go!""\x1b[39;49;00m"
|
||||
|
||||
Reference in New Issue
Block a user