Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Commit a5254e2

Browse files
dmiusDmitry
authored andcommitted
Debug outpu removed + code formating fixed
1 parent c718336 commit a5254e2

File tree

2 files changed

+64
-65
lines changed

2 files changed

+64
-65
lines changed

nancy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ case "$1" in
3333
if [ ! -f "${BASH_SOURCE%/*}/nancy_$1.sh" ]
3434
then
3535
>&2 echo "ERROR: Unknown command."
36+
>&2 echo "Try 'nancy help'"
3637
exit 1;
3738
fi
3839
cmd="${BASH_SOURCE%/*}/nancy_$1.sh"

nancy_run.sh

Lines changed: 63 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -392,85 +392,83 @@ function checkParams() {
392392
([ -z ${TARGET_DDL_UNDO+x} ] && [ ! -z ${TARGET_DDL_DO+x} ]) \
393393
|| ([ -z ${TARGET_DDL_DO+x} ] && [ ! -z ${TARGET_DDL_UNDO+x} ])
394394
); then
395-
>&2 echo "ERROR: DDL code must have do and undo part."
396-
exit 1;
397-
fi
398-
399-
if [ -z ${ARTIFACTS_DESTINATION+x} ]; then
400-
>&2 echo "WARNING: Artifacts destination not given. Will use ./"
401-
ARTIFACTS_DESTINATION="."
402-
fi
395+
>&2 echo "ERROR: DDL code must have do and undo part."
396+
exit 1;
397+
fi
403398

404-
if [ -z ${ARTIFACTS_FILENAME+x} ]
405-
then
406-
>&2 echo "WARNING: Artifacts naming not set. Will use: $DOCKER_MACHINE"
407-
ARTIFACTS_FILENAME=$DOCKER_MACHINE
408-
fi
399+
if [ -z ${ARTIFACTS_DESTINATION+x} ]; then
400+
>&2 echo "WARNING: Artifacts destination not given. Will use ./"
401+
ARTIFACTS_DESTINATION="."
402+
fi
409403

410-
[ ! -z ${WORKLOAD_FULL_PATH+x} ] && ! checkPath WORKLOAD_FULL_PATH \
411-
&& >&2 echo "ERROR: workload file $WORKLOAD_FULL_PATH not found" \
412-
&& exit 1
404+
if [ -z ${ARTIFACTS_FILENAME+x} ]
405+
then
406+
>&2 echo "WARNING: Artifacts naming not set. Will use: $DOCKER_MACHINE"
407+
ARTIFACTS_FILENAME=$DOCKER_MACHINE
408+
fi
413409

414-
echo "WORKLOAD_FULL_PATH: $WORKLOAD_FULL_PATH"
410+
[ ! -z ${WORKLOAD_FULL_PATH+x} ] && ! checkPath WORKLOAD_FULL_PATH \
411+
&& >&2 echo "ERROR: workload file $WORKLOAD_FULL_PATH not found" \
412+
&& exit 1
415413

416-
[ ! -z ${WORKLOAD_BASIS_PATH+x} ] && ! checkPath WORKLOAD_BASIS_PATH \
417-
&& >&2 echo "ERROR: workload file $WORKLOAD_BASIS_PATH not found" \
418-
&& exit 1
414+
[ ! -z ${WORKLOAD_BASIS_PATH+x} ] && ! checkPath WORKLOAD_BASIS_PATH \
415+
&& >&2 echo "ERROR: workload file $WORKLOAD_BASIS_PATH not found" \
416+
&& exit 1
419417

420-
if [ ! -z ${WORKLOAD_CUSTOM_SQL+x} ]; then
421-
checkPath WORKLOAD_CUSTOM_SQL
422-
if [ "$?" -ne "0" ]; then
423-
#>&2 echo "WARNING: Value given as workload-custom-sql: '$WORKLOAD_CUSTOM_SQL' not found as file will use as content"
424-
echo "$WORKLOAD_CUSTOM_SQL" > $TMP_PATH/workload_custom_sql_tmp.sql
425-
WORKLOAD_CUSTOM_SQL="$TMP_PATH/workload_custom_sql_tmp.sql"
426-
else
427-
[ "$DEBUG" -eq "1" ] && echo "DEBUG: Value given as workload-custom-sql will use as filename"
418+
if [ ! -z ${WORKLOAD_CUSTOM_SQL+x} ]; then
419+
checkPath WORKLOAD_CUSTOM_SQL
420+
if [ "$?" -ne "0" ]; then
421+
#>&2 echo "WARNING: Value given as workload-custom-sql: '$WORKLOAD_CUSTOM_SQL' not found as file will use as content"
422+
echo "$WORKLOAD_CUSTOM_SQL" > $TMP_PATH/workload_custom_sql_tmp.sql
423+
WORKLOAD_CUSTOM_SQL="$TMP_PATH/workload_custom_sql_tmp.sql"
424+
else
425+
[ "$DEBUG" -eq "1" ] && echo "DEBUG: Value given as workload-custom-sql will use as filename"
426+
fi
428427
fi
429-
fi
430428

431-
if [ ! -z ${AFTER_DB_INIT_CODE+x} ]; then
432-
checkPath AFTER_DB_INIT_CODE
433-
if [ "$?" -ne "0" ]; then
434-
#>&2 echo "WARNING: Value given as after_db_init_code: '$AFTER_DB_INIT_CODE' not found as file will use as content"
435-
echo "$AFTER_DB_INIT_CODE" > $TMP_PATH/after_db_init_code_tmp.sql
436-
AFTER_DB_INIT_CODE="$TMP_PATH/after_db_init_code_tmp.sql"
437-
else
438-
[ "$DEBUG" -eq "1" ] && echo "DEBUG: Value given as after_db_init_code will use as filename"
429+
if [ ! -z ${AFTER_DB_INIT_CODE+x} ]; then
430+
checkPath AFTER_DB_INIT_CODE
431+
if [ "$?" -ne "0" ]; then
432+
#>&2 echo "WARNING: Value given as after_db_init_code: '$AFTER_DB_INIT_CODE' not found as file will use as content"
433+
echo "$AFTER_DB_INIT_CODE" > $TMP_PATH/after_db_init_code_tmp.sql
434+
AFTER_DB_INIT_CODE="$TMP_PATH/after_db_init_code_tmp.sql"
435+
else
436+
[ "$DEBUG" -eq "1" ] && echo "DEBUG: Value given as after_db_init_code will use as filename"
437+
fi
439438
fi
440-
fi
441439

442-
if [ ! -z ${TARGET_DDL_DO+x} ]; then
443-
checkPath TARGET_DDL_DO
444-
if [ "$?" -ne "0" ]; then
445-
#>&2 echo "WARNING: Value given as target_ddl_do: '$TARGET_DDL_DO' not found as file will use as content"
446-
echo "$TARGET_DDL_DO" > $TMP_PATH/target_ddl_do_tmp.sql
447-
TARGET_DDL_DO="$TMP_PATH/target_ddl_do_tmp.sql"
448-
else
449-
[ "$DEBUG" -eq "1" ] && echo "DEBUG: Value given as target_ddl_do will use as filename"
440+
if [ ! -z ${TARGET_DDL_DO+x} ]; then
441+
checkPath TARGET_DDL_DO
442+
if [ "$?" -ne "0" ]; then
443+
#>&2 echo "WARNING: Value given as target_ddl_do: '$TARGET_DDL_DO' not found as file will use as content"
444+
echo "$TARGET_DDL_DO" > $TMP_PATH/target_ddl_do_tmp.sql
445+
TARGET_DDL_DO="$TMP_PATH/target_ddl_do_tmp.sql"
446+
else
447+
[ "$DEBUG" -eq "1" ] && echo "DEBUG: Value given as target_ddl_do will use as filename"
448+
fi
450449
fi
451-
fi
452450

453-
if [ ! -z ${TARGET_DDL_UNDO+x} ]; then
454-
checkPath TARGET_DDL_UNDO
455-
if [ "$?" -ne "0" ]; then
456-
#>&2 echo "WARNING: Value given as target_ddl_undo: '$TARGET_DDL_UNDO' not found as file will use as content"
457-
echo "$TARGET_DDL_UNDO" > $TMP_PATH/target_ddl_undo_tmp.sql
458-
TARGET_DDL_UNDO="$TMP_PATH/target_ddl_undo_tmp.sql"
459-
else
460-
[ "$DEBUG" -eq "1" ] && echo "DEBUG: Value given as target_ddl_undo will use as filename"
451+
if [ ! -z ${TARGET_DDL_UNDO+x} ]; then
452+
checkPath TARGET_DDL_UNDO
453+
if [ "$?" -ne "0" ]; then
454+
#>&2 echo "WARNING: Value given as target_ddl_undo: '$TARGET_DDL_UNDO' not found as file will use as content"
455+
echo "$TARGET_DDL_UNDO" > $TMP_PATH/target_ddl_undo_tmp.sql
456+
TARGET_DDL_UNDO="$TMP_PATH/target_ddl_undo_tmp.sql"
457+
else
458+
[ "$DEBUG" -eq "1" ] && echo "DEBUG: Value given as target_ddl_undo will use as filename"
459+
fi
461460
fi
462-
fi
463461

464-
if [ ! -z ${TARGET_CONFIG+x} ]; then
465-
checkPath TARGET_CONFIG
466-
if [ "$?" -ne "0" ]; then
467-
#>&2 echo "WARNING: Value given as target_config: '$TARGET_CONFIG' not found as file will use as content"
468-
echo "$TARGET_CONFIG" > $TMP_PATH/target_config_tmp.conf
469-
TARGET_CONFIG="$TMP_PATH/target_config_tmp.conf"
470-
else
471-
[ "$DEBUG" -eq "1" ] && echo "DEBUG: Value given as target_config will use as filename"
462+
if [ ! -z ${TARGET_CONFIG+x} ]; then
463+
checkPath TARGET_CONFIG
464+
if [ "$?" -ne "0" ]; then
465+
#>&2 echo "WARNING: Value given as target_config: '$TARGET_CONFIG' not found as file will use as content"
466+
echo "$TARGET_CONFIG" > $TMP_PATH/target_config_tmp.conf
467+
TARGET_CONFIG="$TMP_PATH/target_config_tmp.conf"
468+
else
469+
[ "$DEBUG" -eq "1" ] && echo "DEBUG: Value given as target_config will use as filename"
470+
fi
472471
fi
473-
fi
474472
}
475473

476474
checkParams;

0 commit comments

Comments
 (0)