Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if homebrew is installed before downloading #23

Closed
wants to merge 1 commit into from

Conversation

nathom
Copy link

@nathom nathom commented May 25, 2021

Right now, install.sh will waste time trying to install Homebrew even if it is installed. I added a check for the brew command so that this issue is fixed. I also removed the sleep statements from the bottom because they're unnecessary.

@Aayush9029
Copy link
Owner

This is amazing, should we also check for YouTube-dl and mpv installation?

Copy link
Contributor

@insomnia-creator insomnia-creator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change installation types to PR #18 , just merge the checks with that. such as rm etc.

@insomnia-creator
Copy link
Contributor

echo "Checking /Installing"
if ! type brew > /dev/null;
then
echo "Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
echo "Installing / Checking dependencies"
if brew ls --versions mpv && brew ls --versions youtube-dl > /dev/null;
then
echo "Not installing because the packages already exist"
else
echo "Installing Dependencies"
brew install mpv
brew install youtube-dl
brew link mpv
brew link youtube-dl

fi

echo "Downloading..."
cd /Applications
curl -LO https://github.com/Aayush9029/Native-Youtube/releases/download/v0.02/Muubii.app.zip

echo "Installing"
unzip -qq Muubii.app.zip
rm Muubii.app.zip

echo "Installed"

echo "Exiting terminal in 3"
sleep 1
echo "2"
sleep 1
echo "1"
sleep 1
exit

Update install.sh with this code, I'll update it on the DMG end.

@insomnia-creator
Copy link
Contributor

This checks if dependencies are installed as well

@insomnia-creator
Copy link
Contributor

CYAN_IS_SUS="\033[0;36m"
RED="\033[0;31m"
YELLOW="\033[0;33m"
PURPLE="\033[0;35m"
GREEN="\033[0;32m"

echo "${YELLOW}Checking / ${RED}Installing"
if ! type brew > /dev/null;
then
echo "${CYAN_IS_SUS}Installing ${GREEN}Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
echo "${PURPLE}Installing / ${YELLOW}Checking dependencies"
if brew ls --versions mpv && brew ls --versions youtube-dl > /dev/null;
then
echo "${GREEN}Not installing because the packages already exist"
else
echo "${CYAN_IS_SUS}Installing Dependencies"
brew install mpv
brew install youtube-dl
brew link mpv
brew link youtube-dl

fi

echo "${YELLOW}Downloading..."
cd /Applications
curl -LO https://github.com/Aayush9029/Native-Youtube/releases/download/v0.02/Muubii.app.zip

echo "${GREEN}Installing"
unzip -qq Muubii.app.zip
rm Muubii.app.zip

echo "${PURPLE}Installed"

echo "${CYAN_IS_SUS}Exiting terminal in 3"
sleep 1
echo "${RED}2"
sleep 1
echo "${YELLOW}1"
sleep 1
exit```

Colourful version

@Aayush9029
Copy link
Owner

#24

@Aayush9029 Aayush9029 closed this Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants