dkbuild: corriger le support des paramètres sans argument

This commit is contained in:
Jephté Clain 2023-01-05 08:48:08 +04:00
parent 68a42d0f6a
commit c36b8fb577
2 changed files with 17 additions and 22 deletions

14
TODO.md
View File

@ -1,16 +1,8 @@
# TODO # TODO
dkbuild dkbuild
* commande 'conf' pour lancer une commande en mode configuration * setversion peut prendre la version depuis la branche git d'un dépôt
* celà permet de définir la version une fois pour toutes * un argument permettrait de spécifier comment la version est calculée à
* commande 'mvn' partir du dépôt
* implémenter resetversion?
* setversion peut prendre la version depuis un fichier VERSION.txt, pom.xml, la
branche git d'un dépôt, etc.
* `setversion from-file= from-repo=`
* `checkout branch= setversion=` (ça nécessite de revoir le workflow, ou
alors ça correspond à resetversion)
* peut-être que l'argument pourrait permettre de spécifier comment la
version est calculée à partir du dépôt
-*- coding: utf-8 mode: markdown -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8:noeol:binary -*- coding: utf-8 mode: markdown -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8:noeol:binary

25
dkbuild
View File

@ -1513,7 +1513,7 @@ function define_functions_cmd() {
local branch="${DEFAULTS[checkout_branch]}" local branch="${DEFAULTS[checkout_branch]}"
local develdir="${DEFAULTS[checkout_develdir]}" local develdir="${DEFAULTS[checkout_develdir]}"
local develtype="${DEFAULTS[checkout_develtype]}" local develtype="${DEFAULTS[checkout_develtype]}"
while [[ "$1" == *=* ]]; do while [ $# -gt 0 ]; do
case "$1" in case "$1" in
checkout) checkout=1;; checkout) checkout=1;;
checkout=*) checkout="${1#checkout=}";; checkout=*) checkout="${1#checkout=}";;
@ -1584,7 +1584,7 @@ function define_functions_cmd() {
local copy="${DEFAULTS[copy_copy]-1}" local copy="${DEFAULTS[copy_copy]-1}"
local overwrite="${DEFAULTS[copy_overwrite]}" local overwrite="${DEFAULTS[copy_overwrite]}"
local gitignore="${DEFAULTS[copy_gitignore]}" local gitignore="${DEFAULTS[copy_gitignore]}"
while [[ "$1" == *=* ]]; do while [ $# -gt 0 ]; do
case "$1" in case "$1" in
copy) copy=1;; copy) copy=1;;
copy=*) copy="${1#copy=}";; copy=*) copy="${1#copy=}";;
@ -1720,7 +1720,7 @@ function define_functions_cmd() {
local context="${DEFAULTS[genfile_context]}" local context="${DEFAULTS[genfile_context]}"
local sed="${DEFAULTS[genfile_sed]}" local sed="${DEFAULTS[genfile_sed]}"
while [[ "$1" == *=* ]]; do while [ $# -gt 0 ]; do
case "$1" in case "$1" in
context=*) context="${1#context=}";; context=*) context="${1#context=}";;
sed=*) sed="${1#sed=}";; sed=*) sed="${1#sed=}";;
@ -1755,7 +1755,7 @@ function define_functions_cmd() {
local context="${DEFAULTS[dockerfile_context]}" local context="${DEFAULTS[dockerfile_context]}"
local sed="${DEFAULTS[dockerfile_sed]}" local sed="${DEFAULTS[dockerfile_sed]}"
while [[ "$1" == *=* ]]; do while [ $# -gt 0 ]; do
case "$1" in case "$1" in
context=*) context="${1#context=}";; context=*) context="${1#context=}";;
sed=*) sed="${1#sed=}";; sed=*) sed="${1#sed=}";;
@ -1818,7 +1818,7 @@ function define_functions_cmd() {
[ "$host_mappings" == __UNDEFINED__ ] && host_mappings="${DEFAULTS[docker_host-mappings]}" [ "$host_mappings" == __UNDEFINED__ ] && host_mappings="${DEFAULTS[docker_host-mappings]}"
local images="${DEFAULTS[build_images]}" local images="${DEFAULTS[build_images]}"
local push="${DEFAULTS[build_push]}" local push="${DEFAULTS[build_push]}"
while [[ "$1" == *=* ]]; do while [ $# -gt 0 ]; do
case "$1" in case "$1" in
build) build=1;; build) build=1;;
build=*) build="${1#build=}";; build=*) build="${1#build=}";;
@ -1911,7 +1911,7 @@ function define_functions_cmd() {
local project_name="${DEFAULTS[cbuild_project-name]}" local project_name="${DEFAULTS[cbuild_project-name]}"
local no_cache="${DEFAULTS[cbuild_no-cache]}" local no_cache="${DEFAULTS[cbuild_no-cache]}"
local pull="${DEFAULTS[cbuild_pull]}" local pull="${DEFAULTS[cbuild_pull]}"
while [[ "$1" == *=* ]]; do while [ $# -gt 0 ]; do
case "$1" in case "$1" in
files=*) files="${1#files=}";; files=*) files="${1#files=}";;
project-name=*) project_name="${1#project-name=}";; project-name=*) project_name="${1#project-name=}";;
@ -1919,7 +1919,8 @@ function define_functions_cmd() {
no-cache=*) no_cache="${1#no-cache=}";; no-cache=*) no_cache="${1#no-cache=}";;
pull) pull=1;; pull) pull=1;;
pull=*) pull="${1#pull=}";; pull=*) pull="${1#pull=}";;
*) ewarn "cbuild: $1: argument ignoré";; *=*) ewarn "cbuild: $1: argument ignoré";;
*) break;;
esac esac
shift shift
done done
@ -2138,7 +2139,7 @@ fi
)" )"
fi fi
while [[ "$1" == *=* ]]; do while [ $# -gt 0 ]; do
case "$1" in case "$1" in
args=*) args="${1#args=}";; args=*) args="${1#args=}";;
php=*) php="${1#php=}";; php=*) php="${1#php=}";;
@ -2149,7 +2150,8 @@ fi
composer=*) composer="${1#composer=}";; composer=*) composer="${1#composer=}";;
setup=*) setup="${1#setup=}";; setup=*) setup="${1#setup=}";;
project-name=*) project_name="${1#project-name=}";; project-name=*) project_name="${1#project-name=}";;
*) ewarn "composer: $1: argument ignoré";; *=*) ewarn "composer: $1: argument ignoré";;
*) break;;
esac esac
shift shift
done done
@ -2404,7 +2406,7 @@ cd "$projdir"
)" )"
fi fi
while [[ "$1" == *=* ]]; do while [ $# -gt 0 ]; do
case "$1" in case "$1" in
args=*) args="${1#args=}";; args=*) args="${1#args=}";;
java=*) java="${1#java=}";; java=*) java="${1#java=}";;
@ -2414,7 +2416,8 @@ cd "$projdir"
mvn=*) mvn="${1#mvn=}";; mvn=*) mvn="${1#mvn=}";;
setup=*) setup="${1#setup=}";; setup=*) setup="${1#setup=}";;
project-name=*) project_name="${1#project-name=}";; project-name=*) project_name="${1#project-name=}";;
*) ewarn "mvn: $1: argument ignoré";; *=*) ewarn "mvn: $1: argument ignoré";;
*) break;;
esac esac
shift shift
done done