Bugfix missing path dir on autostart
This commit is contained in:
parent
2ee59cf722
commit
da9ddd9338
@ -6,7 +6,7 @@ python:
|
|||||||
- 3.5
|
- 3.5
|
||||||
- 3.6
|
- 3.6
|
||||||
- 3.7
|
- 3.7
|
||||||
- 3.8
|
- 3.8-dev
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
update: true
|
update: true
|
||||||
|
|||||||
@ -45,6 +45,11 @@ def get_status():
|
|||||||
# sets the autostart status
|
# sets the autostart status
|
||||||
def set_status(status=ON):
|
def set_status(status=ON):
|
||||||
if status == ON:
|
if status == ON:
|
||||||
|
# make sure dir exists
|
||||||
|
path = target_path()
|
||||||
|
path_dir = os.path.dirname(path)
|
||||||
|
if not os.path.exists(path_dir):
|
||||||
|
os.makedirs(path_dir)
|
||||||
with open(target_path(), 'w') as file:
|
with open(target_path(), 'w') as file:
|
||||||
file.write(template())
|
file.write(template())
|
||||||
elif status == OFF:
|
elif status == OFF:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user