mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
Fix Mac OS install script (#2691)
This commit is contained in:
parent
483b0045fc
commit
6f23869a89
@ -5,8 +5,15 @@ import os
|
|||||||
|
|
||||||
def run(args: str) -> int:
|
def run(args: str) -> int:
|
||||||
"""Run a script."""
|
"""Run a script."""
|
||||||
scripts = [fil[:-3] for fil in os.listdir(os.path.dirname(__file__))
|
scripts = []
|
||||||
if fil.endswith('.py') and fil != '__init__.py']
|
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:
|
if not args:
|
||||||
print('Please specify a script to run.')
|
print('Please specify a script to run.')
|
||||||
|
@ -11,8 +11,7 @@ def install_osx():
|
|||||||
with os.popen('whoami') as inp:
|
with os.popen('whoami') as inp:
|
||||||
user = inp.read().strip()
|
user = inp.read().strip()
|
||||||
|
|
||||||
cwd = os.path.dirname(__file__)
|
template_path = os.path.join(os.path.dirname(__file__), 'launchd.plist')
|
||||||
template_path = os.path.join(cwd, 'startup', 'launchd.plist')
|
|
||||||
|
|
||||||
with open(template_path, 'r', encoding='utf-8') as inp:
|
with open(template_path, 'r', encoding='utf-8') as inp:
|
||||||
plist = inp.read()
|
plist = inp.read()
|
Loading…
x
Reference in New Issue
Block a user