fix bash_completion

This commit is contained in:
Kay0u 2022-01-26 14:19:09 +01:00
parent 9b89f66bba
commit dcf1a892bf
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D
2 changed files with 5 additions and 2 deletions

2
debian/install vendored
View file

@ -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/

View file

@ -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