mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge remote-tracking branch 'origin/unstable' into unstable
This commit is contained in:
commit
f2f88092cf
3 changed files with 35 additions and 1 deletions
|
@ -66,6 +66,10 @@ def _parse_cli_args():
|
||||||
action='store_true', default=False,
|
action='store_true', default=False,
|
||||||
help="Don't produce any output",
|
help="Don't produce any output",
|
||||||
)
|
)
|
||||||
|
parser.add_argument('--admin-password',
|
||||||
|
default=None, dest='password', metavar='PASSWORD',
|
||||||
|
help="The admin password to use to authenticate",
|
||||||
|
)
|
||||||
# deprecated arguments
|
# deprecated arguments
|
||||||
parser.add_argument('--plain',
|
parser.add_argument('--plain',
|
||||||
action='store_true', default=False, help=argparse.SUPPRESS
|
action='store_true', default=False, help=argparse.SUPPRESS
|
||||||
|
@ -199,6 +203,6 @@ if __name__ == '__main__':
|
||||||
from moulinette import cli
|
from moulinette import cli
|
||||||
ret = cli(_retrieve_namespaces(), args,
|
ret = cli(_retrieve_namespaces(), args,
|
||||||
use_cache=opts.use_cache, output_as=opts.output_as,
|
use_cache=opts.use_cache, output_as=opts.output_as,
|
||||||
parser_kwargs={'top_parser': parser}
|
password=opts.password, parser_kwargs={'top_parser': parser}
|
||||||
)
|
)
|
||||||
sys.exit(ret)
|
sys.exit(ret)
|
||||||
|
|
|
@ -27,3 +27,15 @@ ynh_bind_or_cp() {
|
||||||
fi
|
fi
|
||||||
$SUDO_CMD cp -r "$SRCDIR" "$DESTDIR"
|
$SUDO_CMD cp -r "$SRCDIR" "$DESTDIR"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Create a directory under /tmp
|
||||||
|
#
|
||||||
|
# usage: ynh_mkdir_tmp
|
||||||
|
# | ret: the created directory path
|
||||||
|
ynh_mkdir_tmp() {
|
||||||
|
TMPDIR="/tmp/$(ynh_string_random 6)"
|
||||||
|
while [ -d $TMPDIR ]; do
|
||||||
|
TMPDIR="/tmp/$(ynh_string_random 6)"
|
||||||
|
done
|
||||||
|
mkdir -p "$TMPDIR" && echo "$TMPDIR"
|
||||||
|
}
|
||||||
|
|
18
data/apps/helpers.d/setting
Normal file
18
data/apps/helpers.d/setting
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# Get an application setting
|
||||||
|
#
|
||||||
|
# usage: ynh_app_setting_get app key
|
||||||
|
# | arg: app - the application id
|
||||||
|
# | arg: key - the setting to get
|
||||||
|
ynh_app_setting_get() {
|
||||||
|
sudo yunohost app setting "$1" "$2" --output-as plain
|
||||||
|
}
|
||||||
|
|
||||||
|
# Set an application setting
|
||||||
|
#
|
||||||
|
# usage: ynh_app_setting_set app key value
|
||||||
|
# | arg: app - the application id
|
||||||
|
# | arg: key - the setting name to set
|
||||||
|
# | arg: value - the setting value to set
|
||||||
|
ynh_app_setting_set() {
|
||||||
|
sudo yunohost app setting "$1" "$2" -v "$3"
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue