fix: unattended first install on mac

This commit is contained in:
2024-03-07 20:30:31 +00:00
parent e6a7bec30d
commit 7d6d8ae90a
3 changed files with 12 additions and 4 deletions

View File

@@ -9,6 +9,7 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
export NONINTERACTIVE=1 export NONINTERACTIVE=1
if ! command -v brew &> /dev/null; then if ! command -v brew &> /dev/null; then
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
eval "$(/opt/homebrew/bin/brew shellenv)"
fi fi
brew update brew update

View File

@@ -19,7 +19,8 @@ zsh --version
# install oh-my-zsh # install oh-my-zsh
export ZSH="$HOME/.oh-my-zsh" export ZSH="$HOME/.oh-my-zsh"
if [ ! -d "$ZSH" ]; then if [ ! -d "$ZSH" ]; then
bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" # https://github.com/ohmyzsh/ohmyzsh#unattended-install
bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
fi fi
# install zsh-syntax-highlighting # install zsh-syntax-highlighting
@@ -28,7 +29,7 @@ if [ ! -d "$ZSH_SYNTAX_HIGHLIGHTING" ]; then
git clone -q https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_SYNTAX_HIGHLIGHTING git clone -q https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_SYNTAX_HIGHLIGHTING
fi fi
#install zsh-autosuggestions # install zsh-autosuggestions
export ZSH_AUTOSUGGESTIONS="$ZSH/custom/plugins/zsh-autosuggestions" export ZSH_AUTOSUGGESTIONS="$ZSH/custom/plugins/zsh-autosuggestions"
if [ ! -d "$ZSH_AUTOSUGGESTIONS" ]; then if [ ! -d "$ZSH_AUTOSUGGESTIONS" ]; then
git clone -q https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_AUTOSUGGESTIONS git clone -q https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_AUTOSUGGESTIONS

View File

@@ -7,12 +7,11 @@
export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
if ! command -v "pip3" &>/dev/null; then if ! command -v "python" &>/dev/null; then
pyenv install 3.12.1 pyenv install 3.12.1
pyenv global 3.12.1 pyenv global 3.12.1
fi fi
pip install --quiet --upgrade --user pip
pip3 install --quiet --upgrade --user pip pip3 install --quiet --upgrade --user pip
python3 --version python3 --version
pip3 --version pip3 --version
@@ -32,6 +31,13 @@ fi
unset installed_packages pip_dependencies PYTHON_KEYRING_BACKEND unset installed_packages pip_dependencies PYTHON_KEYRING_BACKEND
local_bin_path="$HOME/.local/bin"
if [[ ":$PATH:" != *":$local_bin_path:"* ]]; then
export PATH="$local_bin_path:$PATH"
fi
mkdir -p ~/.local/bin
unset local_bin_path
if ! command -v "pipx" &>/dev/null; then if ! command -v "pipx" &>/dev/null; then
if [[ "$OSTYPE" == "linux-gnu"* ]]; then if [[ "$OSTYPE" == "linux-gnu"* ]]; then
sudo apt-get install -qq pipx sudo apt-get install -qq pipx