mirror of http://git.simp.i2p/simp/i2music.git
21 lines
790 B
Python
Executable File
21 lines
790 B
Python
Executable File
#!/usr/bin/env python
|
|
import subprocess, os
|
|
from sys import platform
|
|
script_directory = os.path.dirname(os.path.abspath(__file__))
|
|
#This will open the virtual environment it was installed on and run the updateplaylists.py script.
|
|
if 'linux' in platform:
|
|
p = 'linux'
|
|
elif 'darwin' in platform:
|
|
p = 'darwin'
|
|
elif 'win' in platform:
|
|
p = 'windows'
|
|
if p != 'windows':
|
|
try:
|
|
subprocess.call(f'cd {script_directory} && source env/bin/activate && python3 -m updateplaylists', shell=True, executable='/bin/bash')
|
|
except Exception as e:
|
|
print(f"Error: {e}")
|
|
else:
|
|
try:
|
|
subprocess.call(f'cd {script_directory} && env\\Scripts\\activate && py -m updateplaylists', shell=True, executable='/bin/bash')
|
|
except Exception as e:
|
|
print(f"Error: {e}") |