mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
strip the dash
This commit is contained in:
parent
e12cc2fbbf
commit
fcad068016
@ -160,20 +160,24 @@ def write_pid(pid_file):
|
|||||||
print('Fatal Error: Unable to write pid file {}'.format(pid_file))
|
print('Fatal Error: Unable to write pid file {}'.format(pid_file))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
def install_osx():
|
def install_osx():
|
||||||
app_path = os.popen('pwd').read().strip()
|
app_path = os.popen('pwd').read().strip()
|
||||||
hass_path = os.popen('which hass').read().strip()
|
hass_path = os.popen('which hass').read().strip()
|
||||||
user = os.popen('whoami').read().strip()
|
user = os.popen('whoami').read().strip()
|
||||||
|
|
||||||
plist = codecs.open('scripts/org.home-assistant.plist', 'r', 'utf-8')
|
plist = codecs.open('scripts/org.homeassistant.plist', 'r', 'utf-8')
|
||||||
plist = plist.read()
|
plist = plist.read()
|
||||||
|
|
||||||
plist = plist.replace("$APP_PATH$", app_path)
|
plist = plist.replace("$APP_PATH$", app_path)
|
||||||
plist = plist.replace("$HASS_PATH$", hass_path)
|
plist = plist.replace("$HASS_PATH$", hass_path)
|
||||||
plist = plist.replace("$USER$", user)
|
plist = plist.replace("$USER$", user)
|
||||||
|
|
||||||
path = os.path.expanduser("~/Library/LaunchAgents/org.home-assistant.plist")
|
path = os.path.expanduser("~/Library/LaunchAgents/org.homeassistant.plist")
|
||||||
|
|
||||||
|
if os.path.isfile(path):
|
||||||
os.remove(path)
|
os.remove(path)
|
||||||
|
|
||||||
plist_file = codecs.open(path, 'w', 'utf-8')
|
plist_file = codecs.open(path, 'w', 'utf-8')
|
||||||
plist_file.write(plist)
|
plist_file.write(plist)
|
||||||
plist_file.close()
|
plist_file.close()
|
||||||
@ -184,7 +188,7 @@ def install_osx():
|
|||||||
|
|
||||||
|
|
||||||
def uninstall_osx():
|
def uninstall_osx():
|
||||||
path = os.path.expanduser("~/Library/LaunchAgents/org.home-assistant.plist")
|
path = os.path.expanduser("~/Library/LaunchAgents/org.homeassistant.plist")
|
||||||
os.popen('launchctl unload ' + path)
|
os.popen('launchctl unload ' + path)
|
||||||
|
|
||||||
print("Home Assistant has been uninstalled.")
|
print("Home Assistant has been uninstalled.")
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>Label</key>
|
<key>Label</key>
|
||||||
<string>org.home-assitant</string>
|
<string>org.homeassitant</string>
|
||||||
|
|
||||||
<key>EnvironmentVariables</key>
|
<key>EnvironmentVariables</key>
|
||||||
<dict>
|
<dict>
|
||||||
@ -30,10 +30,10 @@
|
|||||||
<string>$APP_PATH$</string>
|
<string>$APP_PATH$</string>
|
||||||
|
|
||||||
<key>StandardErrorPath</key>
|
<key>StandardErrorPath</key>
|
||||||
<string>/Users/$USER$/Library/Logs/home-assitant.log</string>
|
<string>/Users/$USER$/Library/Logs/homeassitant.log</string>
|
||||||
|
|
||||||
<key>StandardOutPath</key>
|
<key>StandardOutPath</key>
|
||||||
<string>/Users/$USER$/Library/Logs/home-assitant.log</string>
|
<string>/Users/$USER$/Library/Logs/homeassitant.log</string>
|
||||||
|
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
Loading…
x
Reference in New Issue
Block a user