Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates src #9

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions src/upd8all_updater_unstable.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import os
import sys

def update_pacman():
print("Updating Pacman packages...")
command = "sudo pacman -Syu --noconfirm"
os.system(command)

def update_yay():
print("Updating AUR packages with Yay...")
command = "yay -Syu --noconfirm"
os.system(command)

def update_brew():
print("Updating packages with Homebrew...")
command = "brew update && brew upgrade"
os.system(command)

def check_gh_update():
try:
command = "gh --version"
output = os.popen(command).read()
lines = output.splitlines()
for line in lines:
if "stable" in line and "gh" in line:
version = line.split()[1]
print(f"The updated gh version is: {version}")
except Exception as e:
print(f"Error checking gh update: {e}")

def main():
if os.geteuid() == 0:
print("Error: Please do not run this script as root or using sudo.")
sys.exit(1)
update_pacman()
update_yay()
update_brew()
check_gh_update()

if __name__ == "__main__":
main()