Skip to content

Commit

Permalink
Allow script to run without manual input after first 'yes' (#164)
Browse files Browse the repository at this point in the history
* move pip install logic outside of python install block

* adds pipx installation functionality

* makes script run autonomously after initial yes response

* bump version

---------

Co-authored-by: friend <[email protected]>
  • Loading branch information
cloudymax and friend authored Feb 25, 2023
1 parent c657f82 commit 6a2953a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "onboardme"
version = "0.18.3"
version = "0.18.4"
description = "Install dot files and packages, including a base mode with sensible defaults to run on most computers running Debian based distros or macOS."
authors = ["Jesse Hitch <[email protected]>"]
license = "AGPL-3.0-or-later"
Expand Down
11 changes: 7 additions & 4 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ else
echo "Git not installed or in path, attempting to install git..."
# we use *"linux"* because linux2 is a possibility, and who knows what else
if [[ "$OS" == "Linux"* ]]; then
sudo apt install git
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y git
git_return_code=$?
if [ $git_return_code -ne 0 ]; then
echo "Git didn't install. This may be because you don't have main branch"
Expand Down Expand Up @@ -123,7 +123,7 @@ which brew > /dev/null
brew_return_code=$?
if [ $brew_return_code -ne 0 ]; then
echo "Installing brew really quick, this will require your credentials for sudo abilities..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo -e "\033[92mBrew installed :3 \033[00m"
else
echo -e "\033[92mBrew already installed :3 \033[00m"
Expand All @@ -143,7 +143,8 @@ if [ $py_return_code -ne 0 ]; then
echo -e "\033[92mPython3.11 installed :3 \033[00m"
else
echo "Installing Python3.11 via apt..."
sudo apt install software-properties-common -y
DEBIAN_FRONTEND=noninteractive && \
sudo apt-get install software-properties-common -y && \
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.11
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11
Expand All @@ -155,7 +156,9 @@ else
pip_return_code=$?
if [ $pip_return_code -ne 0 ]; then
echo -e "\033[92mInstalling pip via apt... \033[00m"
sudo apt-get update && sudo apt-get install -y python3-pip pipx python3-venv
DEBIAN_FRONTEND=noninteractive && \
sudo apt-get update && \
sudo apt-get install -y python3-pip pipx python3-venv
pipx ensurepath
echo -e "\033[92mPip3.11 installed :3 \033[00m"
fi
Expand Down

0 comments on commit 6a2953a

Please sign in to comment.