make-brew-installer
-nouveau nom -ajout de l’installation des Command Line Tools -ajout de l’installationde Homebrew
This commit is contained in:
47
_test/installer.sh
Executable file
47
_test/installer.sh
Executable file
@@ -0,0 +1,47 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo '#!/bin/bash' >> brew-install.sh
|
||||||
|
|
||||||
|
echo '
|
||||||
|
installCLT() {
|
||||||
|
|
||||||
|
echo -e "/n Installing Command Line Tools (CLT) for Xcode"
|
||||||
|
sudo xcode-select --install
|
||||||
|
}' >> brew-install.sh
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
echo '
|
||||||
|
if [[ $(command -v brew) == "" ]]; then
|
||||||
|
installHomebrew
|
||||||
|
else
|
||||||
|
echo "Updating Homebrew"
|
||||||
|
brew update
|
||||||
|
fi' >> brew-install.sh
|
||||||
|
|
||||||
|
chmod +x brew-install.sh
|
||||||
31
_test/usage.sh
Executable file
31
_test/usage.sh
Executable file
@@ -0,0 +1,31 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
help=0
|
||||||
|
latest=0
|
||||||
|
verbose=0
|
||||||
|
status=0
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
cat <<-EOF
|
||||||
|
${0##*/} [options]
|
||||||
|
options:
|
||||||
|
-h show help dialog
|
||||||
|
-l reinstall packages with version "latest"
|
||||||
|
-v verbose output
|
||||||
|
EOF
|
||||||
|
exit "$status"
|
||||||
|
}
|
||||||
|
|
||||||
|
for opt
|
||||||
|
do case "$opt" in
|
||||||
|
'-h') usage ;;
|
||||||
|
'-l') latest=1 ;;
|
||||||
|
'-v') verbose=1 ;;
|
||||||
|
*) status=1 usage ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
echo "toto"
|
||||||
|
|
||||||
|
exit "$status"
|
||||||
@@ -30,14 +30,58 @@ echo -e "\033[32m Green World \033[0m"
|
|||||||
COMMENT
|
COMMENT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if [ -f brew-install.sh ]; then
|
if [ -f brew-install.sh ]; then
|
||||||
echo -e "Le fichier \033[93mbrew-install.sh\033[0m existe déjà! On l'efface."
|
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."
|
#echo "Le fichier ${bold}brew-install.sh${normal} existe déjà! On l'efface."
|
||||||
rm brew-install.sh
|
rm brew-install.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo '#!/bin/bash' >> brew-install.sh
|
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 "\n# Brew packages that I use alot.\n" >> brew-install.sh
|
||||||
echo -e "🍺 Get Homebrew \033[3m\033[93mpackages\033[0m installed list"
|
echo -e "🍺 Get Homebrew \033[3m\033[93mpackages\033[0m installed list"
|
||||||
brew list | sed -e 's/^/brew install /' >> brew-install.sh
|
brew list | sed -e 's/^/brew install /' >> brew-install.sh
|
||||||
Reference in New Issue
Block a user