mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Few fixes
This commit is contained in:
parent
4fcc1642d6
commit
e6afa54b49
2 changed files with 9 additions and 2 deletions
|
@ -818,6 +818,9 @@ hook:
|
|||
help: Action folder to store into
|
||||
file:
|
||||
help: Script to check
|
||||
-n:
|
||||
full: --name
|
||||
help: Destination name for the script
|
||||
|
||||
### hook_callback()
|
||||
callback:
|
||||
|
|
|
@ -31,19 +31,23 @@ from yunohost import YunoHostError, YunoHostLDAP, win_msg, colorize
|
|||
|
||||
hook_folder = '/usr/share/yunohost/hooks/'
|
||||
|
||||
def hook_add(action, file):
|
||||
def hook_add(action, file, name=None):
|
||||
"""
|
||||
Store hook script to filsystem
|
||||
|
||||
Keyword argument:
|
||||
file -- Script to add
|
||||
action -- Action folder to store into
|
||||
name -- Destination name
|
||||
|
||||
"""
|
||||
try: os.listdir(hook_folder + action)
|
||||
except OSError: os.makedirs(hook_folder + action)
|
||||
|
||||
os.system('cp '+ file +' '+ hook_folder + action)
|
||||
if name is None:
|
||||
name = ''
|
||||
|
||||
os.system('cp '+ file +' '+ hook_folder + action +'/'+ name)
|
||||
|
||||
|
||||
def hook_callback(action, args=None):
|
||||
|
|
Loading…
Add table
Reference in a new issue