Skip to content

Commit

Permalink
feat: add a setup script
Browse files Browse the repository at this point in the history
Run pikaraoke-setup after installing package.
  • Loading branch information
mariugul committed Aug 20, 2024
1 parent fedd6ed commit 2d0e973
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions pikaraoke/setup_apt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import subprocess


def run_command(command):
result = subprocess.run(command, shell=True, text=True)
if result.returncode != 0:
raise Exception(f"ERROR: '{command}' failed with error code: {result.returncode}")


# Create an alias function for apt
def apt(command):
run_command(f"sudo apt-get {command}")


def main():
print("*** INSTALLING REQUIRED BINARIES ***")
apt("update --allow-releaseinfo-change")
apt("install ffmpeg -y")
apt("install chromium-browser -y")
apt("install chromium-chromedriver -y")


if __name__ == "__main__":
main()
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pytest = "^6.2.5"

[tool.poetry.scripts]
pikaraoke = "pikaraoke.app:main"
pikaraoke-setup = "pikaraoke.setup_apt:main"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down

0 comments on commit 2d0e973

Please sign in to comment.