Created
August 21, 2021 12:41
-
-
Save MichelePipi/41b724f6dbacc23134931d460d5953aa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import platform | |
arch_type = platform.uname() | |
arm64 = False | |
if 'arm64' in platform.uname(): | |
print("arm64 detected (M1 probably)") | |
arm64 = True | |
else: | |
print("i386 Detected (Probably Intel") | |
brew_exists = os.popen('command -v brew').read() | |
if brew_exists == '': | |
print("Brew not detected. Do you want to install it?") | |
install_brew = input("Install: (y/n): ") | |
if install_brew == 'y': | |
install_brew = True | |
print("Installing brew... this may freeze for a bit.") | |
os.popen('/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"').read() | |
else: | |
install_brew = False | |
print("Not installing brew...") | |
else: | |
print("Brew Detected, installing dependencies.. THIS MAY FREEZE, BUT IT IS WORKING CORRECTLY.") | |
os.popen('HOMEBREW_NO_AUTO_UPDATE=1 brew install zstd gnu-tar wget').read() | |
print("Downloading bootstrap...") | |
if arm64: | |
os.popen('wget -q --show-progress https://cdn.discordapp.com/attachments/763074782220517467/819588605999317022/bootstrap.tar.zst').read() | |
else: | |
os.popen('wget -q --show-progress https://cdn.discordapp.com/attachments/763074782220517467/819588655403499560/bootstrap.tar.zst').read() | |
print("Bootstrapping Procursus.... THIS MAY FREEZE, BUT IT IS WORKING.") | |
os.popen('sudo -S gtar --preserve-permissions -xkf bootstrap.tar.zst -C /').read() | |
print("Adding Procursus to PATH...") | |
os.popen('sudo -S sh -c "echo /opt/procursus/bin >> /etc/paths"').read() | |
os.popen('sudo -S sh -c "echo /opt/procursus/sbin >> /etc/paths"').read() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment