Closed joshua-redfield closed 13 years ago
i'll fix it right now.
How do you intend to do so? Most of these errors are caused by checking against lauf_exec1-lauf_exec999. Which if you set $lauf_exec2=unset will fix the error but it'll also erase what's being passed to the plugin(If there's someting in $lauf_exec2). I originally thought this was going to be an easy fix, not sure of that anymore.
Perhaps parameter substitution is the key? For example: ${lauf_exec2:=default_value}
i've never seen a problem in lauf_exec vars, but if there are ones, you could probably just add something to clear vars in the actual lauf script
EDIT: Ah, just saw the message about parameter substitution. I'll try that instead
Not sure how you haven't seen the unexpected operator error involving lauf_exec vars because I have yet to see one that isn't caused by them. Anyways parameter substition definitely solves this problem, tested them on my local branch. Simply put, every lauf_exec var needs to be substituted to a default value if the variable is emtpy.
Example: if [ ${lauf_exec2:=unset} = "-" ] && [ ! ${lauf_exec3:=unset} = "" ]; then chmod a-x "${_plugin}" lauf_notify "Plugin Deactivated:" "${_plugin}" return elif [ ${lauf_exec2:=unset} = "+" ] && [ ! ${lauf_exec3:=unset} = "" ]; then chmod a+x "${_plugin}" lauf_notify "Plugin Activated:" "${_plugin}" return elif [ ${lauf_exec2:=unset} = "--" ]; then cd $lauf_plugindir chmod a-x ._ lauf_notify "Plugin Deactivated:" "All plugins" return elif [ ${lauf_exec2:=unset} = "++" ]; then cd $lauf_plugindir chmod a+x ._ lauf_notify "Plugin Activated:" "All plugins" return fi
This no longer affects core plugins, Have yet to still convert external ones.
Fixed and closed.
This seems to be valid for almost every core plugin and external one. The unexpected operator error is caused by using the test statement against blank variables. Fix should be easy, variable=unset for each and every variable that's causing this error. Much like the lauf_app_options bug, there's no rush on fixing this.