1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wekan_ynh.git synced 2024-09-03 20:36:09 +02:00
This commit is contained in:
yalh76 2023-07-27 20:24:42 +02:00
parent 7cfef9db6a
commit 2a0a666194
2 changed files with 11 additions and 11 deletions

View file

@ -7,7 +7,7 @@
# dependencies used by the app
pkg_dependencies=""
nodejs_version="14.19.3"
nodejs_version="14.21.3"
#=================================================
# PERSONAL HELPERS

View file

@ -10,8 +10,8 @@ YNH_MONGO_VERSION=${YNH_MONGO_VERSION:-$YNH_DEFAULT_MONGO_VERSION}
# example: ynh_mongo_exec --command='db.getMongo().getDBNames().indexOf("wekan")'
# example: ynh_mongo_exec --command="db.getMongo().getDBNames().indexOf(\"wekan\")"
#
# usage: ynh_mongo_exec [--user=user] [--password=password] [--authenticationdatabase=authenticationdatabase] [--database=database] [--host=host] [--port=port] --command="command" [--eval]
# | arg: -u, --user= - The user name to connect as
# usage: ynh_mongo_exec [--username=username] [--password=password] [--authenticationdatabase=authenticationdatabase] [--database=database] [--host=host] [--port=port] --command="command" [--eval]
# | arg: -u, --username= - The user name to connect as
# | arg: -p, --password= - The user password
# | arg: -d, --authenticationdatabase= - The authenticationdatabase to connect to
# | arg: -d, --database= - The database to connect to
@ -24,8 +24,8 @@ YNH_MONGO_VERSION=${YNH_MONGO_VERSION:-$YNH_DEFAULT_MONGO_VERSION}
ynh_mongo_exec() {
# Declare an array to define the options of this helper.
local legacy_args=upadhPce
local -A args_array=( [u]=user= [p]=password= [a]=authenticationdatabase= [d]=database= [h]=host= [P]=port= [c]=command= [e]=eval )
local user
local -A args_array=( [u]=username= [p]=password= [a]=authenticationdatabase= [d]=database= [h]=host= [P]=port= [c]=command= [e]=eval )
local username
local password
local authenticationdatabase
local database
@ -35,7 +35,7 @@ ynh_mongo_exec() {
local eval
# Manage arguments with getopts
ynh_handle_getopts_args "$@"
user="${user:-}"
username="${username:-}"
password="${password:-}"
authenticationdatabase="${authenticationdatabase:-}"
database="${database:-}"
@ -43,10 +43,10 @@ ynh_mongo_exec() {
port="${port:-}"
eval=${eval:-0}
# If user is provided
if [ -n "$user" ]
# If username is provided
if [ -n "$username" ]
then
user="--username=$user"
username="--username=$username"
# If password is provided
if [ -n "$password" ]
@ -89,7 +89,7 @@ ynh_mongo_exec() {
database=""
fi
mongosh --quiet --username $user --password $password --authenticationDatabase $authenticationdatabase --host $host --port $port <<EOF
mongosh --quiet $username $password $authenticationdatabase $host $port <<EOF
$database
${command}
quit()
@ -103,7 +103,7 @@ EOF
database=""
fi
mongosh --quiet $database --username $user --password $password --authenticationDatabase $authenticationdatabase --host $host --port $port --eval="$command"
mongosh --quiet $database $username $password $authenticationdatabase $host $port --eval="$command"
fi
}