[FIX] Some variables problems, export bash command reassignment, etc.

This commit is contained in:
Olivier DOSSMANN 2016-02-15 11:40:16 +01:00
parent 42aeb4972b
commit 30126e9daf

View File

@ -152,7 +152,7 @@ test_postgresql_exists() {
test_postgresql_launched() { test_postgresql_launched() {
PSQL_RUNNING=$($docker_cmd inspect --format="{{ .State.Running }}" ${POSTGRES_DOCKER_NAME} 2> /dev/null) PSQL_RUNNING=$($docker_cmd inspect --format="{{ .State.Running }}" ${POSTGRES_DOCKER_NAME} 2> /dev/null)
if test $PSQL_RUNNING == "false"; then if test "$PSQL_RUNNING" == "false"; then
return 1 return 1
fi fi
return 0 return 0
@ -204,7 +204,7 @@ test_export() {
fi fi
} }
export() { export_command() {
# Check all variables are availables # Check all variables are availables
test_create test_create
# Then check some specific things for dump method # Then check some specific things for dump method
@ -222,7 +222,7 @@ init() {
info "Python virtual environment initialized." info "Python virtual environment initialized."
fi fi
cd $PROJECT_DIR cd $PROJECT_DIR
# On Fedora 23: postgresql-libs python3-devel python-virtualenv git-core python3-pip # On Fedora 23: gcc postgresql-devel python3-devel python-virtualenv git-core python3-pip redhat-rpm-config gmp-devel
sudo apt-get install -qq libpq-dev python3-dev python-virtualenv git-core python3-pip || error_and_quit "Dependancies installation failed." sudo apt-get install -qq libpq-dev python3-dev python-virtualenv git-core python3-pip || error_and_quit "Dependancies installation failed."
info "Dependancies via apt-get checked/installed." info "Dependancies via apt-get checked/installed."
if ! test -d "$GISSMO_DIR/.git/"; then if ! test -d "$GISSMO_DIR/.git/"; then
@ -362,7 +362,13 @@ fi
if ! test -z $COMMAND; then if ! test -z $COMMAND; then
check_command "$COMMAND" check_command "$COMMAND"
$COMMAND # To avoid 'export' bash command reassignement which made some failure in
#+ Python virtualenv
if "$COMMAND" == "export"; then
export_command
else
$COMMAND
fi
else else
show_help show_help
fi fi