mirror of
https://github.com/YunoHost-Apps/etherpad_mypads_ynh.git
synced 2024-09-03 18:36:09 +02:00
Fix comments and helper usage
This commit is contained in:
parent
daa1ba1975
commit
d94a1d3678
2 changed files with 16 additions and 5 deletions
|
@ -41,7 +41,14 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
|||
|
||||
ynh_script_progression --message="Listing all pads..." --weight=3
|
||||
|
||||
mysql -u $db_name -p$db_pwd $db_name --silent -e 'select distinct substring(store.key,5,locate(":",store.key,5)-5) as "pads" from store where store.key like "pad:%"' | sed 's/^/>> /g' >&2
|
||||
# Get the list of pads from the database
|
||||
pad_list="$(ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name <<< \
|
||||
"select distinct substring(store.key,5,locate(\":\",store.key,5)-5) as \"pads\" from store where store.key like \"pad:%\"")"
|
||||
|
||||
# Remove empty lines
|
||||
# Name the first line "> List of pads"
|
||||
# Then for the second lines and following, add >> before the name of the pad.
|
||||
ynh_print_info --message="$(echo "$pad_list" | sed '/^$/d' | sed '1 s/^/> List of /' | sed '2,$s/^/>> /g')"
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
|
|
|
@ -58,12 +58,16 @@ then
|
|||
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/settings.json"
|
||||
if [ "$export" = "abiword" ]
|
||||
then
|
||||
abiword_path=`which abiword` # Get abiword binary path
|
||||
ynh_replace_string --match_string="\"abiword\" : null" --replace_string="\"abiword\" : \"$abiword_path\"" --target_file="$final_path/settings.json" # Renseigne l'emplacement de abiword dans la config de etherpad
|
||||
# Get abiword binary path
|
||||
abiword_path=`which abiword`
|
||||
# Set the path of abiword into etherpad config
|
||||
ynh_replace_string --match_string="\"abiword\" : null" --replace_string="\"abiword\" : \"$abiword_path\"" --target_file="$final_path/settings.json"
|
||||
elif [ "$export" = "libreoffice" ]
|
||||
then
|
||||
soffice_path=`which soffice` # Get soffice binary path
|
||||
ynh_replace_string --match_string="\"soffice\" : null" --replace_string="\"soffice\" : \"$soffice_path\"" --target_file="$final_path/settings.json" # Renseigne l'emplacement de abiword dans la config de etherpad
|
||||
# Get soffice binary path
|
||||
soffice_path=`which soffice`
|
||||
# Set the path of soffice into etherpad config
|
||||
ynh_replace_string --match_string="\"soffice\" : null" --replace_string="\"soffice\" : \"$soffice_path\"" --target_file="$final_path/settings.json"
|
||||
fi
|
||||
ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/settings.json"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue