dk: afficher un warning si le profil n'est pas défini pour une machine
This commit is contained in:
parent
45976f45c2
commit
1b12cee1fb
10
dk
10
dk
|
@ -1700,15 +1700,25 @@ if [ -n "$DM_SET_MACHINE" ]; then
|
||||||
[ "$DM_SET_MACHINE" == - ] && DM_SET_MACHINE=-u
|
[ "$DM_SET_MACHINE" == - ] && DM_SET_MACHINE=-u
|
||||||
setx dm_env=docker-machine env "$DM_SET_MACHINE" || die
|
setx dm_env=docker-machine env "$DM_SET_MACHINE" || die
|
||||||
eval "$dm_env"
|
eval "$dm_env"
|
||||||
|
# pour warning ci-dessous
|
||||||
|
[ "$DM_SET_MACHINE" == -u ] && DM_SET_MACHINE=
|
||||||
fi
|
fi
|
||||||
if [ -n "$DM_AVAILABLE" ]; then
|
if [ -n "$DM_AVAILABLE" ]; then
|
||||||
|
found=
|
||||||
for dm_profile in "${DM_PROFILES[@]}"; do
|
for dm_profile in "${DM_PROFILES[@]}"; do
|
||||||
splitpair "$dm_profile" dm profile
|
splitpair "$dm_profile" dm profile
|
||||||
if [ "$dm" == "$DOCKER_MACHINE_NAME" ]; then
|
if [ "$dm" == "$DOCKER_MACHINE_NAME" ]; then
|
||||||
DEFAULT_PROFILE="$profile"
|
DEFAULT_PROFILE="$profile"
|
||||||
|
found=1
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
if [ -n "$DM_SET_MACHINE" -a -z "$PROFILE" -a -z "$found" ]; then
|
||||||
|
ewarn "\
|
||||||
|
Aucun profil n'a été défini pour $DM_SET_MACHINE dans ~/etc/default/dk
|
||||||
|
== Le profil $DEFAULT_PROFILE sera utilisé =="
|
||||||
|
sleep 3
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# construire par défaut
|
# construire par défaut
|
||||||
|
|
Loading…
Reference in New Issue