-nouveau nom -ajout de l’installation des Command Line Tools -ajout de l’installationde Homebrew
98 lines
2.5 KiB
Bash
Executable File
98 lines
2.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ "$1" == "-h" ]; then
|
|
echo "Create Homebrew 's packages and Casks installed list:"
|
|
echo " a brew-install.sh script is created next to this script..."
|
|
echo
|
|
echo "USAGE: brew-list [-p]"
|
|
echo
|
|
echo " -p just packages (not Casks)"
|
|
echo " -h display this help"
|
|
echo
|
|
exit 0
|
|
fi
|
|
|
|
<<COMMENT
|
|
underline=`tput smul`
|
|
nounderline=`tput rmul`
|
|
bold=`tput bold`
|
|
normal=`tput sgr0`
|
|
echo "toto"
|
|
|
|
echo -e "\033[1m bold \033[0m"
|
|
echo -e "\033[3m italic \033[0m"
|
|
echo -e "\033[4m underline \033[0m"
|
|
echo -e "\033[1;3;31m Red bold+italic \033[0m"
|
|
echo -e "\033[9m strikethrough \033[0m"
|
|
echo -e "\033[31m Red World \033[0m"
|
|
echo -e "\033[93m Yellow World \033[0m"
|
|
echo -e "\033[32m Green World \033[0m"
|
|
COMMENT
|
|
|
|
|
|
|
|
|
|
if [ -f brew-install.sh ]; then
|
|
echo -e "The file \033[93mbrew-install.sh\033[0m already exist! We erase it."
|
|
#echo "Le fichier ${bold}brew-install.sh${normal} existe déjà! On l'efface."
|
|
rm brew-install.sh
|
|
fi
|
|
|
|
echo '#!/bin/bash' >> brew-install.sh
|
|
|
|
# function for installing homebrew
|
|
echo '
|
|
installHomebrew() {
|
|
echo -e "/n Installing Homebrew"
|
|
#/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
|
#sudo chown -R $USER /usr/local/
|
|
#export $PATH=/usr/local/bin:$PATH
|
|
brew update
|
|
}' >> brew-install.sh
|
|
|
|
|
|
#if type xcode-select >&- && xpath=$( xcode-select --print-path ) &&
|
|
# test -d "${xpath}" && test -x "${xpath}" ; then
|
|
# #... is correctly installed
|
|
#else
|
|
# #... isn't correctly installed
|
|
#fi
|
|
|
|
|
|
# test if CLT is installed
|
|
echo '
|
|
# test if CLT is installed' >> brew-install.sh
|
|
echo '
|
|
clt=$(xcode-select --install 2>&1 | grep installed)
|
|
if [ -n "$clt" ]; then
|
|
echo "Command Line Tools (CLT) for Xcode already installed";
|
|
else
|
|
echo "Installing Command Line Tools (CLT) for Xcode";
|
|
fi' >> brew-install.sh
|
|
|
|
# test if homebrew is installed
|
|
echo '
|
|
# test if Homebrew is installed' >> brew-install.sh
|
|
echo '
|
|
if [[ $(command -v brew) == "" ]]; then
|
|
installHomebrew
|
|
else
|
|
echo "Updating Homebrew"
|
|
brew update
|
|
fi
|
|
' >> brew-install.sh
|
|
|
|
echo -e "\n# Brew packages that I use alot.\n" >> brew-install.sh
|
|
echo -e "🍺 Get Homebrew \033[3m\033[93mpackages\033[0m installed list"
|
|
brew list | sed -e 's/^/brew install /' >> brew-install.sh
|
|
|
|
if [ "$1" != "-p" ]; then
|
|
echo -e "\n# Some casks packages that I like.\n" >> brew-install.sh
|
|
echo -e "🍺 Get Homebrew \033[3m\033[93mCask\033[0m installed list"
|
|
brew cask list | sed -e 's/^/brew cask install /' >> brew-install.sh
|
|
fi
|
|
|
|
chmod +x brew-install.sh
|
|
|
|
terminal-notifier -title 'brew-list' -message 'Packages & casks list created !' -sound 'Glass'
|