Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AvenCores authored Jun 25, 2023
1 parent 5397243 commit 766e1b7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
8 changes: 4 additions & 4 deletions native-install.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from sys import platform
from sys import executable, platform
import subprocess


if platform == "win32":
subprocess.run(["pip", "install", "-r", "requirements.txt"], shell=True)
subprocess.run([executable, "-m", "pip", "install", "-r", "requirements.txt"])

if platform == "linux" or platform == "linux2" or platform == "unix":
subprocess.run(["pip3", "install", "-r", "requirements.txt"], shell=True)
if platform.startswith("linux"):
subprocess.run([executable, "-m", "pip", "install", "-r", "requirements.txt"])
8 changes: 4 additions & 4 deletions native-start.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from sys import platform
from sys import platform, executable, argv
import subprocess


if platform == "win32":
subprocess.run(["python", "main.py", "%*"], shell=True)
subprocess.run([executable, "main.py"] + argv[1:])

if platform == "linux" or platform == "linux2" or platform == "unix":
subprocess.run(["python3", "main.py"], shell=True)
if platform.startswith("linux"):
subprocess.run([executable, "main.py"] + argv[1:])
12 changes: 7 additions & 5 deletions venv-install.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
import subprocess
import os


activate_script_windows = os.path.join("venv", "Scripts", "activate")
activate_script_linux = os.path.join("venv", "bin", "activate")

if platform == "win32":
if not os.path.isdir("venv"):
subprocess.run(["python", "-m", "venv", "venv"])
subprocess.run([f"call", f"{activate_script_windows}", "&&", "pip", "install", "-r", "requirements.txt"], shell=True)

if platform == "linux" or platform == "linux2" or platform == "unix":
subprocess.run(["python3", "-m", "venv", "venv"])
subprocess.run([f"source," f"{activate_script_linux}", "&&", "pip3", "install", "-r", "requirements.txt"], shell=True)
if platform == "win32":
subprocess.run([f"cmd /c {activate_script_windows} && pip install -r requirements.txt"], shell=True)

if platform.startswith("linux"):
subprocess.run([f"source {activate_script_linux} && pip3 install -r requirements.txt"], shell=True)
7 changes: 4 additions & 3 deletions venv-start.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
import subprocess
import os


activate_script_windows = os.path.join("venv", "Scripts", "activate")
activate_script_linux = os.path.join("venv", "bin", "activate")

if platform == "win32":
subprocess.run([f"call", f"{activate_script_windows}", "&&", "python", "main.py", "%*"], shell=True)
subprocess.run([f"cmd /c {activate_script_windows} && python main.py"], shell=True)

if platform == "linux" or platform == "linux2" or platform == "unix":
subprocess.run([f"source", f"{activate_script_linux}", "&&", "python3", "main.py"], shell=True)
if platform.startswith("linux"):
subprocess.run([f"source {activate_script_linux} && python3 main.py"], shell=True)

0 comments on commit 766e1b7

Please sign in to comment.