Skip to content
Open
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
17 changes: 16 additions & 1 deletion better-pkg
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ def setup_argparse():
install_parser.add_argument('-c', '--plugin', action='store_true', help='Install better-pkg plugin.')
install_parser.add_argument('-s', '--sclassic', action='store_true', help='Use snap --classic.')
install_parser.add_argument('-k', '--bcask', action='store_true', help='Use brew --cask.')
install_parser.add_argument('-l', '--layer', action='store_true', help='Use RPM-ostree or similar tools.')
install_parser.add_argument('-b', '--file', action='store_true', help='Install package from file.')
install_parser.add_argument('-y', action='store_true', help='Automatic yas to prompts.')
install_parser.add_argument('-m', '--manager', choices=['apt', 'dnf', 'pacman', 'yay', 'paru', 'flatpak', 'snap', 'brew', 'pacstall', 'zypper', 'betterpkg'], help='Force install from specific package manager')
Expand Down Expand Up @@ -3642,10 +3643,24 @@ def install(args):
subprocess.run(["brew", "install", "--cask", package], check=True)
print(f"{colors.BGreen}Successfully installed {package} with brew --cask.{colors.NC}")
except subprocess.CalledProcessError as e:
print(f"{colors.BRed}Failed to install {package} with brew --caska: {e}{colors.NC}")
print(f"{colors.BRed}Failed to install {package} with brew --cask: {e}{colors.NC}")
else:
print(f"{colors.BRed}Brew is not installed on this system.{colors.NC}")
return

# Layering support
if args.layer:
for package in expanded_packages:
if shutil.which("rpm-ostree"):
print(f"{colors.BCyan}Layering {package} with RPM-ostree...{colors.NC}")
try:
subprocess.run(["rpm-ostree", "install", package], check=True)
print(f"{colors.BGreen}Successfully installed {package} with RPM-ostree.{colors.NC}")
except subprocess.CalledProcessError as e:
print(f"{colors.BRed}Failed to install {package} with RPM-ostree: {e}{colors.NC}")
else:
print(f"{colors.BRed}RPM-Ostree is not installed on this system.{colors.NC}")
return

# Instalace z daného package manageru
if getattr(args, "manager", None):
Expand Down