Skip to content

Instantly share code, notes, and snippets.

@Debdut
Last active August 3, 2020 14:39
Show Gist options
  • Save Debdut/329424721dba89703931c85b5011ca74 to your computer and use it in GitHub Desktop.
Save Debdut/329424721dba89703931c85b5011ca74 to your computer and use it in GitHub Desktop.
echo
echo "[Downloading DesignCode.io]"
echo
sleep 5
echo
echo "Checking For Aria2"
echo
if ! command -v aria2c &> /dev/null
then
echo "Aria2 could not be found"
echo "Installing Aria2"
echo
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo "Ubuntu / GNU Linux Detected"
echo
sudo apt install aria2
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "Mac OS Detected"
echo
brew install aria2
elif [[ "$OSTYPE" == "cygwin" ]]; then
sudo "Cygwin Emulator Detected"
echo
sudo apt install aria2
elif [[ "$OSTYPE" == "msys" ]]; then
echo "MinGW Emulator Detected"
echo
sudo apt install aria2
else
echo "No Install Scripts of Aria2 for your OS"
exit
fi
else
echo "Aria2 is installed"
echo "Proceeding To Download Links"
echo
fi
rm -rf design-code.links
rm -rf design-code
aria2c https://gist.githubusercontent.com/Debdut/329424721dba89703931c85b5011ca74/raw/baaa0c7336db3166945d9281ab8026890d384c9a/design-code.links
echo
echo "Proceeding To Download Files"
echo "Please keep the process on until download is completed"
echo
rm -rf ./design-code
mkdir ./design-code
aria2c -d ./design-code/ -x 5 -j 4 -i ./design-code.links
echo
echo "Files Downloaded Successfully"
echo
echo "Checking For Unzip"
echo
if ! command -v unzip &> /dev/null
then
echo "Unzip could not be found"
echo "Installing Unzip"
echo
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo "Ubuntu / GNU Linux Detected"
echo
sudo apt install unzip
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "Mac OS Detected"
echo
brew install unzip
elif [[ "$OSTYPE" == "cygwin" ]]; then
sudo "Cygwin Emulator Detected"
echo
sudo apt install unzip
elif [[ "$OSTYPE" == "msys" ]]; then
echo "MinGW Emulator Detected"
echo
sudo apt install unzip
else
echo "No Install Scripts of Unzip for your OS"
exit
fi
else
echo
echo "Unzip is installed"
echo "Proceeding To Unzip"
echo
fi
cd design-code
rm -rf *.aria2
find . -name '*.zip' -exec sh -c 'echo "Unzipping $1" && unzip -d "${1%.*}" "$1" && rm "$1"' _ {} \;
find . -name '*.zip' -exec sh -c 'echo "Unzipping $1" && unzip -d "${1%.*}" "$1" && rm "$1"' _ {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment