Create the subdirectory for the config file if it does not exist, and fix the
return value for the editor command.
E_GSU_BAD_OPTION_TYPE invalid option type
E_GSU_BAD_ARG_COUNT invalid number of arguments
E_GSU_EDITOR failed to execute editor
+E_GSU_MKDIR failed to create directory
$gsu_errors
"
local a b i=0
local i conf="${gsu_config_file:=$HOME/.$gsu_name.rc}"
if [[ "$1" = "-e" ]]; then
+ ret=-$E_GSU_MKDIR
+ result="${conf%/*}"
+ mkdir -p "$result"
+ [[ $? -ne 0 ]] && return
ret=-$E_GSU_EDITOR
result="${EDITOR:-vi}"
"$result" "$conf"
+ [[ $? -ne 0 ]] && return
ret=$GSU_SUCCESS
return
fi