Skip to content

Commit

Permalink
Add cmdline args to skip parts of the installer
Browse files Browse the repository at this point in the history
Added `--use-existing-config` to skip the y/n prompt for the config file
Added `--no-install` to skip the installation of binaries and-
startup services
  • Loading branch information
Radiicall committed Nov 19, 2023
1 parent f7b3771 commit aa0fd4e
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions scripts/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import subprocess
import platform
from time import sleep
import sys

path = ""

Expand All @@ -20,7 +21,7 @@

subprocess.run(["mkdir", "-p", path.removesuffix("main.json")])
else:
path = os.environ["APPDATA"].removesuffix("\\") + "\jellyfin-rpc\main.json"
path = os.environ["APPDATA"].removesuffix("\\") + "\\jellyfin-rpc\\main.json"
subprocess.run(["powershell", "-Command", f'mkdir "{path.removesuffix("main.json")}"'], stdout=subprocess.DEVNULL)

print("""
Expand All @@ -32,11 +33,19 @@

if os.path.isfile(path):
print(f"Found existing config: {path}")
while True:
current = input("Use existing config? (y/N): ").lower()
if current == "n" or current == "y" or current == "":

for arg in sys.argv:
if arg == "--use-existing-config":
print("Using existing config")
current = "y"
break
print("Invalid input, please type y or n")

if current != "y":
while True:
current = input("Use existing config? (y/N): ").lower()
if current == "n" or current == "y" or current == "":
break
print("Invalid input, please type y or n")

if current == "n" or current == "":
print("----------Jellyfin----------")
Expand Down Expand Up @@ -227,6 +236,11 @@
file.write(json.dumps(config, indent=2))
file.close()

for arg in sys.argv:
if arg == "--no-install":
print("Skipping installation")
exit(0)

while True:
val = input("Do you want to download Jellyfin-RPC? (Y/n): ").lower()

Expand Down

0 comments on commit aa0fd4e

Please sign in to comment.