Skip to content

Commit

Permalink
addds command line tool support
Browse files Browse the repository at this point in the history
  • Loading branch information
ribalba committed Sep 19, 2023
1 parent 755656d commit b34e968
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,34 @@ set -euo pipefail
GREEN='\033[0;32m'
NC='\033[0m' # No Color

# Function to check and install Xcode Command Line Tools
install_xcode_clt() {
if xcode-select --print-path &>/dev/null; then
echo "Xcode Command Line Tools are already installed!"
return
fi

xcode-select --install &>/dev/null

echo "Installing Xcode Command Line Tools..."

while true; do
if xcode-select --print-path &>/dev/null; then
echo "Installation completed!"
return
fi

if ! pgrep "Install Command Line Developer Tools" &>/dev/null; then
echo "Installation was canceled or failed!"
exit 1
fi

sleep 5
done
}

# Call the function to ensure Xcode Command Line Tools are installed
install_xcode_clt

# Define download URLs
FILE_URL="https://raw.githubusercontent.com/green-coding-berlin/hog/main/power_logger.py"
Expand Down

0 comments on commit b34e968

Please sign in to comment.