From 3ed502894c3ba5338f1b8f2565adaebc8e463d86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Sun, 10 Apr 2016 19:20:40 +0200 Subject: [PATCH] [fix] Skip hidden and temp files in hook_list --- src/yunohost/hook.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/yunohost/hook.py b/src/yunohost/hook.py index 00e06d365..3ee11947a 100644 --- a/src/yunohost/hook.py +++ b/src/yunohost/hook.py @@ -176,6 +176,8 @@ def hook_list(action, list_by='name', show_info=False): def _append_folder(d, folder): # Iterate over and add hook from a folder for f in os.listdir(folder + action): + if f[0] == '.' or f[-1] == '~': + continue path = '%s%s/%s' % (folder, action, f) priority, name = _extract_filename_parts(f) _append_hook(d, priority, name, path)