Fix Mac OS install script (#2691)
This commit is contained in:
parent
483b0045fc
commit
6f23869a89
3 changed files with 10 additions and 4 deletions
|
@ -5,8 +5,15 @@ import os
|
|||
|
||||
def run(args: str) -> int:
|
||||
"""Run a script."""
|
||||
scripts = [fil[:-3] for fil in os.listdir(os.path.dirname(__file__))
|
||||
if fil.endswith('.py') and fil != '__init__.py']
|
||||
scripts = []
|
||||
path = os.path.dirname(__file__)
|
||||
for fil in os.listdir(path):
|
||||
if fil == '__pycache__':
|
||||
continue
|
||||
elif os.path.isdir(os.path.join(path, fil)):
|
||||
scripts.append(fil)
|
||||
elif fil != '__init__.py' and fil.endswith('.py'):
|
||||
scripts.append(fil[:-3])
|
||||
|
||||
if not args:
|
||||
print('Please specify a script to run.')
|
||||
|
|
|
@ -11,8 +11,7 @@ def install_osx():
|
|||
with os.popen('whoami') as inp:
|
||||
user = inp.read().strip()
|
||||
|
||||
cwd = os.path.dirname(__file__)
|
||||
template_path = os.path.join(cwd, 'startup', 'launchd.plist')
|
||||
template_path = os.path.join(os.path.dirname(__file__), 'launchd.plist')
|
||||
|
||||
with open(template_path, 'r', encoding='utf-8') as inp:
|
||||
plist = inp.read()
|
Loading…
Add table
Reference in a new issue