Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Helpers 2.1 #1720

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

Draft: Helpers 2.1 #1720

wants to merge 2 commits into from

Conversation

Salamandar
Copy link
Contributor

@Salamandar Salamandar commented Sep 30, 2023

Those helpers (not all are reimplemented) present multiple changes :

  • A new underlying library based on bash-modules https://github.com/vlisivka/bash-modules/tree/master/bash-modules with a reworked logging code (it allows stdin and args inputs).
    It contains a lot of helpers, like string::empty, string::contains, array::contains, etc, that reeeaaally help readability.
  • A new arguments::parse library from bash-modules, way more competent and readable than the current one
  • A new function name schema ynh::<module>::<function>, e.g ynh::systemd::action. For me it kinda helps knowing what a function is about when reading code.
  • A lot of the current yunohost code is string-based, even for lists of things. I'm trying here to use more arrays.

This really just is a draft about what could be a future version of the helpers, to have feedback about what it looks like.

Nice examples to read are ynh::fail2ban::add and ynh::setting::get.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant