From dcf1a892bfb530ee782546d2f0f852a164f9ef3d Mon Sep 17 00:00:00 2001 From: Kay0u Date: Wed, 26 Jan 2022 14:19:09 +0100 Subject: [PATCH] fix bash_completion --- debian/install | 2 +- doc/generate_bash_completion.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/debian/install b/debian/install index db88462ab..5169d0b62 100644 --- a/debian/install +++ b/debian/install @@ -5,6 +5,6 @@ helpers/* /usr/share/yunohost/helpers.d/ conf/* /usr/share/yunohost/conf/ locales/* /usr/share/yunohost/locales/ doc/yunohost.8.gz /usr/share/man/man8/ -doc/bash-completion.sh /etc/bash_completion.d/yunohost +doc/bash_completion.d/* /etc/bash_completion.d/ conf/metronome/modules/* /usr/lib/metronome/modules/ src/* /usr/lib/python3/dist-packages/yunohost/ diff --git a/doc/generate_bash_completion.py b/doc/generate_bash_completion.py index 72a524210..d55973010 100644 --- a/doc/generate_bash_completion.py +++ b/doc/generate_bash_completion.py @@ -13,7 +13,8 @@ import yaml THIS_SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) ACTIONSMAP_FILE = THIS_SCRIPT_DIR + "/../share/actionsmap.yml" -BASH_COMPLETION_FILE = THIS_SCRIPT_DIR + "/bash-completion.sh" +BASH_COMPLETION_FOLDER = THIS_SCRIPT_DIR + "/bash_completion.d" +BASH_COMPLETION_FILE = BASH_COMPLETION_FOLDER + "/yunohost" def get_dict_actions(OPTION_SUBTREE, category): @@ -61,6 +62,8 @@ with open(ACTIONSMAP_FILE, "r") as stream: OPTION_TREE[category]["subcategories"], subcategory ) + os.makedirs(BASH_COMPLETION_FOLDER, exist_ok=True) + with open(BASH_COMPLETION_FILE, "w") as generated_file: # header of the file