-
Notifications
You must be signed in to change notification settings - Fork 18
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
return function #59
return function #59
Conversation
why do we need to print the path to log? |
You have added $FUNCNAME in some calls to the function log Otherwise it would be possible to validate it only with a parameter manjaro-architect -p ? |
Sorry to bother you. I just would like to understand ... learning daily on the way here ... |
oops, |
Ok, that's what I tought 😉 |
When you say "optional arg" do I understand you right that we can introduce the function like this without the need to add a third arg to every present call for check_for_error? So even though both args 2 and 3 we need to specify at least two for the function to be happy, right? |
yes optional :
in code is :
if $2 not set $2 = 0 error code so if you want only log you can write Parameter Substitution Advanced Bash-Scripting Guide |
Is this ready to be merged? |
@papajoker optional args are awesome. Thank you! |
Also the thing with _canceldlg var doesn't really seems to work out. I just ended up in some kind of a confused menu where I was not able to quit the installer but was sent back to main_menu and behaviour of cancel buttons became somehow confused... |
remove FUNCNAME[*] in log for _canceldlg, Yes, this feature should not exist, normally it should never have check_errors right after a dialog, or then pass it to second parameter 0 and not $? |
Makes sense. So we need to find and amend those instances and only use one arg. |
yes, pass 0 is the solution |
It's here: https://github.com/Chrysostomus/manjaro-architect/blob/master/lib/util-disk.sh#L439 |
check_for_error wait integer as param two, quote not necessary the error here is the structure, the AND : && ...
|
I think I have adjusted them all now. Should be fine to remove |
NO , too speed ;) _canceldlg removed now if errcode !=0 always call fonction_menu |
ah, grrr, yes of course! ;) |
if path too long ? can reduce, last 4 for exemple :
local _fpath="${FUNCNAME[*]:1:4}()"